<%@ page language="java" contentType="text/html; charset=UTF-8"	 pageEncoding="UTF-8"%>
<%@ include file="../include/laypublic.jsp"%>
<!DOCTYPE html>
<html>
<head>
  <title>承继协议原合同</title>
</head>
<style>
#contract-breakdown {
	cursor: pointer;
}
#contract-investment-info .layui-form-item:nth-child(n+2) {
   display:none;
}
#contract-investment-info .layui-inline .layui-form-label {
	position: relative;
	text-align: left;
}

#contract-investment-info .layui-inline:nth-child(1) .layui-form-label {
	left: 160px;
}

#contract-investment-info .layui-inline:nth-child(2) .layui-form-label {
	left: 120px;
}

#contract-investment-info .layui-inline:nth-child(3) .layui-form-label {
	left: 115px;
}

.margin-lt10 {
	margin-left: 10px;
}

.layui-row+.layui-row {
	margin-top: 36px;
}

.tg-l {
	text-align: left;
}

.tg-c {
	text-align: center;
}

.tg-r {
	text-align: right;
}

.contract-list {
	margin-top: 20px;
}

.contract-box {
	width: 100%;
	min-height: 100px;
}

.contract-money {
	width: 90%;
	margin: 0 auto;
}

.contract-money .layui-table {
	margin: 0;
}

.contract-money th {
	text-align: center;
	height: 38px;
}

.contract-money .label {
	display: block;
	width: 45px !important;
	text-align: left;
	margin-left: 15px;
}

.fieldset {
	margin-top: 5px;
	margin-bottom: 0px
}

.layui-legend {
	background-color: #5fb878;
	font-size: 15px !important;
	width: 140px;
}

.layui-form-item {
	margin-bottom: 5px;
	clear: both;
	*zoom: 1;
}

.layui-form-label {
	width: 160px;
}

</style>
<body>
	<div class="layui-fluid">
		<div class="layui-card">
			<div style="padding-top: 15px;">&nbsp;</div>
			<form class="layui-form" id="addInfo_form" lay-filter="addInfo_form">
				<div class="layui-tab layui-tab-brief" >
					<div class="layui-tab-content">
						<div class="layui-tab-item layui-show">
							<fieldset class="layui-elem-field layui-field-title fieldset"
								id="baseInfo">
								<legend class="layui-btn layui-legend"
									style="text-align: left; cursor: default;">项目基础信息></legend>
								<input type="hidden" name="judge" value="1">
								<div class="layui-form-item">
									<div class="layui-inline">
										<label class="layui-form-label">申请公司</label>
										<div class="layui-input-inline">
											<input type="hidden" name="hrOrgid" value="${bindOrgId}">
											<input type="text" value="${bindOrgName}"
												style="border: 0px;width:220px" readonly="readonly" class="layui-input">
										</div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label">申请部门</label>
										<div class="layui-input-inline">
											<input type="hidden" name="hrDeptid" value="${bindDeptId}">
											<input type="text" value="${bindDeptName}"
												style="border: 0px;" readonly="readonly" class="layui-input">
										</div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label">申请人</label>
										<div class="layui-input-inline">
											<input type="hidden" name="hrStaffApplyid"
												value="${SESSION_KEY_USER_DETAIL.hrStaffId }"> <input
												type="text" name="staffname" value="${SESSION_KEY_USER_DETAIL.realName }"
												readonly="readonly" style="border: 0px" autocomplete="off"
												class="layui-input">
										</div>
									</div>
								</div>
								<div class="layui-form-item">
									<div class="layui-inline">
										<label class="layui-form-label">项目名称</label>
										<div class="layui-input-inline">
											<select id="add_select_proId" name="proCodeAndCodes"
												lay-filter="add_select_proId" lay-verify="required"
												lay-search>
												<option value="">请选择-项目名称</option>
												<c:if test="${not empty proContractList }">
													<c:forEach items="${proContractList}" var="proContract">
														<option value="${proContract.proCode }_${proContract.id }">${proContract.proName }
														</option>
													</c:forEach>
												</c:if>
											</select>
										</div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label">项目编号</label>
										<div class="layui-input-inline">
											<input type="text" id="id_proCode" name="proCode" value="" style="border: 0px;"
												readonly="readonly" class="layui-input">
										</div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label">区域公司</label>
										<div class="layui-input-inline">
											<input type="hidden" id="areaId" name="hrOrgAreaId" value="">
											<input type="text" id="id_regionalCompany"
												value="" readonly="readonly"
												style="border: 0px;width:220px" autocomplete="off" class="layui-input">
										</div>
									</div>
								</div>
								<div class="layui-form-item">
									<div class="layui-inline">
										<label class="layui-form-label">项目公司</label>
										<div class="layui-input-inline">
											<input type="hidden" id="compId" name="hrOrgProId" value=""> <input
												type="text" id="id_projectCompany" value=""
												style="border: 0px;width:220px" readonly="readonly" class="layui-input">
										</div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label">实施机构</label>
										<div class="layui-input-inline">
											<input type="text" id="id_ImplementingBody" name="carryOrg" style="border: 0px;width:220px"
												readonly="readonly" class="layui-input">
										</div>
									</div>

									<div class="layui-inline">
										<label class="layui-form-label">项目地址</label>
										<div class="layui-input-inline">
											<input type="text" id="id_projectAddress" name="projectAddress" value=""
												style="border: 0px;" readonly="readonly" class="layui-input">
										</div>
									</div>
								</div>
								<div class="layui-form-item">
									<div class="layui-inline">
										<label class="layui-form-label">项目负责人</label>
										<div class="layui-input-inline">
											<input type="text" id="id_projectLeader" name="proLeader" placeholder="请输入"
												readonly="readonly" maxlength="10" lay-verify="required|COC" autocomplete="off"
												class="layui-input">
										</div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label">承继协议名称</label>
										<div class="layui-input-inline">
											<input type="text" id="id_successionAgreementName" name="contractExtName"
												placeholder="请输入" maxlength="100" lay-verify="required|COC"
												autocomplete="off" class="layui-input">
										</div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label">承继协议编码（选填）</label>
										<div class="layui-input-inline">
											<input type="text" id="id_supplementaryAgreementCode" name="contractExtCode"
												placeholder="请输入" maxlength="50"
												autocomplete="off" class="layui-input">
										</div>
									</div>
								</div>
								<div class="layui-form-item">
									<div class="layui-inline">
										<label class="layui-form-label" >承继协议签订日期（选填）</label>
										<div class="layui-input-inline">
											<input type="text" class="layui-input" id="id_successionAgreementDate" name="signDate" readonly placeholder="承继协议签订日期" />
										</div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label" >是否与项目合同信息一致</label>
										<div class="layui-input-inline">
											<select id="is-it-consistent"  lay-filter="is-it-consistent" lay-verify="required" >
												<option value="1" >是</option>
												<option value="2" >否</option>
											</select>
										</div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label">计价方式</label>
										<div class="layui-input-inline">
											<select id="add_from-bisModify" name="valueMode"
												lay-verify="required">
												<option value="">请选择</option>
												<option value="1">清单</option>
												<option value="2">定额</option>
												<option value="3">固定总价</option>
												<option value="4">其它</option>
											</select>
										</div>
									</div>
								</div>
								<div class="layui-form-item">
									<label class="layui-form-label">调价方式</label>
									<div class="layui-input-block">
										<textarea id="id_priceAdjustmentMethod" name="riseMode"
											placeholder="请输入最多100字" 
											class="layui-textarea" maxlength="500" lay-verify="required"
											style="width: 899px; height: 90px;"></textarea>
									</div>
								</div>
								<div class="layui-form-item">
									<div class="layui-inline">
										<label class="layui-form-label">业态</label>
										<div class="layui-input-inline">
											<select id="id_format" name="bizType" lay-verify="required">
												<option value="">请选择</option>

												<option value="1">公路</option>
												<option value="2">市政</option>
												<option value="3">铁路</option>
												<option value="4">房建</option>
												<option value="5">棚改</option>
												<option value="6">学校</option>
												<option value="7">综合</option>
												<option value="8">医疗及养老</option>
												<option value="9">土地増减挂钩</option>
											</select>
										</div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label">是否入库</label>
										<div class="layui-input-inline">
											<select id="id_is_in_store" name="isInStore"
												lay-verify="required">
												<option value="">请选择</option>

												<option value="0">未入库</option>
												<option value="1">已入库</option>

											</select>
										</div>
									</div>

									<div class="layui-inline">
										<label class="layui-form-label">回报机制</label>
								      	<input type="hidden" id="id_backMech" name="backMech">
							      		<div class="layui-input-inline">
								      		<input type="checkbox" name="backMechs" value="1" disabled="disabled" title="政府付费" lay-skin="primary">
							      		</div>
							      		<div class="layui-input-inline">
											<input type="checkbox" name="backMechs" value="2" disabled="disabled" title="可行性缺口补助" lay-skin="primary"> 
							      		</div>
							      		<div class="layui-input-inline">
											<input type="checkbox" name="backMechs" value="3" disabled="disabled" title="使用者付费" lay-skin="primary"> 
							      		</div>
							      		<div class="layui-input-inline">
											<input type="checkbox" name="backMechs" value="4" disabled="disabled" title="其他" lay-skin="primary"> 
							      		</div>
									</div>
								</div>
								<div class="layui-form-item">
									<div class="layui-inline">
										<label class="layui-form-label">合同建设期（年）</label>
										<div class="layui-input-inline">
											<input type="text" id="id_Contractconstructionperiodyear" name="buildYears"
												onblur="checkValueverifyNumber2(this);"
												lay-verify="required|floatNumber" placeholder="请输入" maxlength="100"
												autocomplete="off" class="layui-input">
										</div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label">合同运营期（年）</label>
										<div class="layui-input-inline">
											<input type="text" id="id_Contractoperationperiodyear" name="omYears"
												onblur="checkValueverifyNumber2(this);" placeholder="请输入"
												maxlength="100" lay-verify="required|floatNumber" autocomplete="off"
												class="layui-input">
										</div>
									</div>

									<div class="layui-inline">
										<label class="layui-form-label">总合同期（年）</label>
										<div class="layui-input-inline">
											<input type="text" id="id_Totalcontractperiodyear" name="totalYears"
												onblur="checkValueverifyNumber2(this);" placeholder="请输入"
												maxlength="100" lay-verify="required|floatNumber" autocomplete="off"
												class="layui-input">
										</div>
									</div>
								</div>
								<div class="layui-form-item">
									<div class="layui-inline">
										<label class="layui-form-label">合同建设期（天）</label>
										<div class="layui-input-inline">
											<input type="text" id="id_Contractconstructionperioddays" name="buildDays"
												readonly="readonly" placeholder="请输入" maxlength="100"
												lay-verify="required|COC" autocomplete="off"
												class="layui-input">
										</div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label">合同运营期（天）</label>
										<div class="layui-input-inline">
											<input type="text" id="id_Contractoperationperioddays" name="omDays"
												readonly="readonly" placeholder="请输入" maxlength="100"
												lay-verify="required|COC" autocomplete="off"
												class="layui-input">
										</div>
									</div>

									<div class="layui-inline">
										<label class="layui-form-label">总合同期（天）</label>
										<div class="layui-input-inline">
											<input type="text" id="id_Totalcontractperioddays" name="totalDays"
												readonly="readonly" placeholder="请输入" maxlength="100"
												lay-verify="required|COC" autocomplete="off"
												class="layui-input">
										</div>
									</div>
								</div>
								<div class="layui-form-item">
									<div class="layui-inline">
										<label class="layui-form-label">合同开工日期</label>
										<div class="layui-input-inline">
											<input type="text" class="layui-input"
												id="id_contractCommencementDate"
												name="beginBuildDate" readonly lay-verify="required"
												placeholder="合同开工日期">
										</div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label">建安竣工日期</label>
										<div class="layui-input-inline">
											<input type="text" class="layui-input" lay-verify="required"
												id="id_completionDateOfConstructionAndinstallation"
												name="endCaeDate" readonly
												placeholder="建安竣工日期">
										</div>
									</div>

									<div class="layui-inline">
										<label class="layui-form-label">运营结束日期</label>
										<div class="layui-input-inline">
											<input type="text" class="layui-input" lay-verify="required"
												id="id_operationEndDate" name="endOmDate" readonly
												placeholder="运营结束日期">
										</div>
									</div>
								</div>
							</fieldset>
							<fieldset class="layui-elem-field layui-field-title fieldset"
								id="baseInfo">
								<legend class="layui-btn layui-legend"
									style="text-align: left; cursor: default;">合同投资信息></legend>
								<!-- 按钮区域  -->

<!-- 								<div class="layui-form-item" >
									<div class="layui-inline" style="float:right" >
										<label class="layui-form-label" id="contract-breakdown" style="color:#01AAED;" >编辑合同分解清单></label>
										<div class="layui-input-inline">
											<input type="text" name="showInx" value="" readonly="readonly" style="border: 0px" class="layui-input">
										</div>
									</div>
								</div> -->
								
								<div class="layui-form-item">
									<div class="layui-inline">
										<label class="layui-form-label">序号</label>
										<div class="layui-input-inline">
											<input type="text" name="showInx" value=""
												readonly="readonly" style="border: 0px" class="layui-input">
										</div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label">费用名称</label>
										<div class="layui-input-inline">
											<input type="text" name="showInx" value=""
												readonly="readonly" style="border: 0px" class="layui-input">
										</div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label">金额（元）</label>
										<div class="layui-input-inline">
											<input type="text" name="showInx" value=""
												readonly="readonly" style="border: 0px" class="layui-input">
										</div>
									</div>
								</div>
								<div class="layui-form-item">
									<!-- 灰色分割线 -->
									<!-- 	<hr class="layui-bg-gray">-->
								</div>
							</fieldset>
							
							<fieldset class="layui-elem-field layui-field-title fieldset" id="contract-investment-info" >
							    <div class="layui-form-item" >
							    <br/>
							    <br/>
							    <br/>
							    <br/>
								</div>
								<div class="layui-form-item" >
									<div class="layui-inline" >
										<label class="layui-form-label">1</label>
										<div class="layui-input-inline"></div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label">建安工程费</label>
										<div class="layui-input-inline"></div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label" id="caeFeeLabel">100,000.09</label>
										<div class="layui-input-inline" ><input type="hidden" id="caeFeeId" name="caeFee" value="100,000.09" /></div>
									</div>
								</div>
								<div class="layui-form-item">
									<div class="layui-inline">
										<label class="layui-form-label"></label>
										<div class="layui-input-inline"></div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label " style="left:130px;" >*建安下浮率（综合）</label>
										<div class="layui-input-inline"></div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label" id="caeDownRateLabel">13%</label>
										<div class="layui-input-inline" ><input type="hidden" id="caeDownRateId" name="caeDownRate" value="13" /></div>
									</div>
								</div>
								<div class="layui-form-item">
									<div class="layui-inline">
										<label class="layui-form-label"></label>
										<div class="layui-input-inline"></div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label" style="left:130px;"  >*建安占比</label>
										<div class="layui-input-inline"></div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label" id="caeRateLabel">50%</label>
										<div class="layui-input-inline"><input type="hidden" id="caeRateId" name="caeRate" value="50" /></div>
									</div>
								</div>
								<div class="layui-form-item">
									<div class="layui-inline">
										<label class="layui-form-label">2</label>
										<div class="layui-input-inline"></div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label">预备费</label>
										<div class="layui-input-inline"></div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label" id="prepareFeeLabel">100,000.09</label>
										<div class="layui-input-inline" ><input type="hidden" id="prepareFeeId" name="prepareFee" value="100,000.09" /></div>
									</div>
								</div>
								<div class="layui-form-item">
									<div class="layui-inline">
										<label class="layui-form-label">3</label>
										<div class="layui-input-inline"></div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label">建安工程其他费</label>
										<div class="layui-input-inline" ></div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label" id="buildOtherFeeLabel">100,000.09</label>
										<div class="layui-input-inline" ><input type="hidden" id="buildOtherFeeId" name="buildOtherFee" value="100,000.09" /></div>
									</div>
								</div>
								<div class="layui-form-item">
									<div class="layui-inline">
										<label class="layui-form-label">3.1</label>
										<div class="layui-input-inline"></div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label">建设单位管理费</label>
										<div class="layui-input-inline"></div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label" id="buildOrgFeeLabel">100,000.09</label>
										<div class="layui-input-inline" ><input type="hidden" id="buildOrgFeeId" name="buildOrgFee" value="100,000.09" /></div>
									</div>
								</div>
								<div class="layui-form-item">
									<div class="layui-inline">
										<label class="layui-form-label">3.2</label>
										<div class="layui-input-inline"></div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label">政府代付费</label>
										<div class="layui-input-inline"></div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label" id="gdReplaceFeeLabel">100,000.09</label>
										<div class="layui-input-inline"><input type="hidden" id="gdReplaceFeeId" name="gdReplaceFee" value="100,000.09" /></div>
									</div>
								</div>
								<div class="layui-form-item">
									<div class="layui-inline">
										<label class="layui-form-label">3.3</label>
										<div class="layui-input-inline"></div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label">项目前期费</label>
										<div class="layui-input-inline"></div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label" id="preFeeLabel">100,000.09</label>
										<div class="layui-input-inline"><input type="hidden" id="preFeeId" name="preFee" value="100,000.09" /></div>
									</div>
								</div>
								<div class="layui-form-item">
									<div class="layui-inline">
										<label class="layui-form-label">3.3.1</label>
										<div class="layui-input-inline"></div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label">征地拆迁费</label>
										<div class="layui-input-inline"></div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label" id="moveFeeLabel">100,000.09</label>
										<div class="layui-input-inline"><input type="hidden" id="moveFeeId" name="moveFee" value="100,000.09" /></div>
									</div>
								</div>
								<div class="layui-form-item">
									<div class="layui-inline">
										<label class="layui-form-label">4</label>
										<div class="layui-input-inline"></div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label">建设期利息</label>
										<div class="layui-input-inline"></div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label" id="buildInterestLabel">100,000.09</label>
										<div class="layui-input-inline"><input type="hidden" id="buildInterestId" name="buildInterest" value="100,000.09" /></div>
									</div>
								</div>
								<div class="layui-form-item">
									<div class="layui-inline">
										<label class="layui-form-label">5</label>
										<div class="layui-input-inline"></div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label">设备及工器具购置</label>
										<div class="layui-input-inline"></div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label" id="buyFeeLabel">100,000.09</label>
										<div class="layui-input-inline"><input type="hidden" id="buyFeeId" name="buyFee" value="100,000.09" /></div>
									</div>
								</div>
								<div class="layui-form-item">
									<div class="layui-inline">
										<label class="layui-form-label">6</label>
										<div class="layui-input-inline"></div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label">铺底流动资金</label>
										<div class="layui-input-inline"></div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label" id="flowFeeLabel">100,000.09</label>
										<div class="layui-input-inline"><input type="hidden" id="flowFeeId" name="flowFee" value="100,000.09" /></div>
									</div>
								</div>
								<div class="layui-form-item">
									<hr class="layui-bg-gray">
								</div>
								<div class="layui-form-item">
									<div class="layui-inline">
										<label class="layui-form-label"></label>
										<div class="layui-input-inline"></div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label">投资合计</label>
										<div class="layui-input-inline" ></div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label" id="totalSumLabel">12,000,000.09</label>
										<div class="layui-input-inline" ><input type="hidden"  id="totalSumId" name="totalSum" value="12,000,000.09"  />
										<input type="hidden"  id="outPreDownAmountId" name="outPreDownAmount" value="12,000,000.09"  />
										<input type="hidden"  id="outPreDownRateId" name="outPreDownRate" value="12,000,000.09"  />
										<input type="hidden"  id="outAfterDownAmountId" name="outAfterDownAmount" value="12,000,000.09"  />
										</div>
									</div>
								</div>
							</fieldset>
					
							
							
							<fieldset class="layui-elem-field layui-field-title fieldset"
								id="baseInfo">
								<legend class="layui-btn layui-legend"
									style="text-align: left; cursor: default;">商务指标></legend>
								<div class="layui-form-item">
									<div class="layui-inline">
										<label class="layui-form-label">银行融资资金（元）</label>
										<div class="layui-input-inline">
											<input type="text" id="bankFundId" name="bankFund" placeholder="请输入银行融资资金（元）"
												maxlength="20" lay-verify="required|floatNumber" autocomplete="off"
												onblur="isNumberAndFloat3();arabiaToCN(this,1);" class="layui-input">
										</div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label">银行融资资金占比（%）</label>
										<div class="layui-input-inline">
											<input type="text" id="bankFundPercentId" name="bankFundPercent"
												maxlength="20" lay-verify="required|floatNumber" autocomplete="off"
												style="border: 0px;" readonly="readonly" class="layui-input">
										</div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label">自有资本金（元）</label>
										<div class="layui-input-inline">
											<input type="text" id="selfFundId" name="selfFund" placeholder="请输入自有资本金（元）"
												maxlength="20" lay-verify="required|floatNumber" autocomplete="off"
												onblur="isNumberAndFloat3();arabiaToCN(this,1);" class="layui-input">
										</div>
									</div>

								</div>
								<div class="layui-form-item">
									<div class="layui-inline">
										<label class="layui-form-label">自有资本金占比（%）</label>
										<div class="layui-input-inline">
											<input type="text" id="selfFundPercentId" name="selfFundPercent"
												maxlength="20" lay-verify="required|floatNumber" autocomplete="off"
												style="border: 0px;" readonly="readonly" class="layui-input">
										</div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label">政府资本金（元）</label>
										<div class="layui-input-inline">
											<input type="text" id="gdFundId" name="gdFund" placeholder="请输入政府资本金（元）"
												maxlength="20" lay-verify="required|floatNumber" autocomplete="off"
												onblur="isNumberAndFloat3();arabiaToCN(this,1);" class="layui-input">
										</div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label">政府资本金占比（%）</label>
										<div class="layui-input-inline">
											<input type="text" id="gdFundPercentId" name="gdFundPercent"
												maxlength="20" lay-verify="required|floatNumber" autocomplete="off"
												style="border: 0px;" readonly="readonly" class="layui-input">
										</div>
									</div>

								</div>
								<div class="layui-form-item">
									<div class="layui-inline">
										<label class="layui-form-label">自有资本金回报率（%）</label>
										<div class="layui-input-inline">
											<input type="text" id="selfBackRateId" name="selfBackRate"
												placeholder="请输入自有资本金回报率（%)" maxlength="20"
												lay-verify="required|floatNumber" autocomplete="off"
												onblur="isNumberAndFloat1(this);" class="layui-input">
										</div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label">建设期融资利率（%）</label>
										<div class="layui-input-inline">
											<input type="text" id="buildCapRateId" name="buildCapRate"
												placeholder="请输入建设期融资利率（%)" maxlength="20"
												lay-verify="required|floatNumber" autocomplete="off"
												onblur="isNumberAndFloat1(this);" class="layui-input">
										</div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label">银行融资回报率（%）</label>
										<div class="layui-input-inline">
											<input type="text" id="bankBackRateId" name="bankBackRate"
												placeholder="请输入银行融资回报率（%)" maxlength="20"
												lay-verify="required|floatNumber" autocomplete="off"
												onblur="isNumberAndFloat1(this);" class="layui-input">
										</div>
									</div>

								</div>
								<div class="layui-form-item">
									<div class="layui-inline">
										<label class="layui-form-label">年运营绩效服务费（元）</label>
										<div class="layui-input-inline">
											<input type="text" id="perOmFeeId" name="perOmFee"
												placeholder="请输入年运营绩效服务费（元）" maxlength="20"
												lay-verify="required|floatNumber" autocomplete="off"
												onblur="isNumberAndFloat1(this);arabiaToCN(this,1);" class="layui-input">
										</div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label">折现率（%）</label>
										<div class="layui-input-inline">
											<input type="text" id="cashRateId" name="cashRate" placeholder="请输入折现率（%)"
												maxlength="20" lay-verify="required|floatNumber" autocomplete="off"
												onblur="isNumberAndFloat1(this);" class="layui-input">
										</div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label">投资回报率（%）</label>
										<div class="layui-input-inline">
											<input type="text" id="investBackRateId" name="investBackRate" placeholder="请输入投资回报率（%)"
												maxlength="20" lay-verify="required|floatNumber" autocomplete="off"
												onblur="isNumberAndFloat1(this);" class="layui-input">
										</div>
									</div>

								</div>
								<div class="layui-form-item">
									<div class="layui-inline">
										<label class="layui-form-label">年兜底运营收入（元）</label>
										<div class="layui-input-inline">
											<input type="text" id="perBottomOmIncomeId" name="perBottomOmIncome" placeholder="请输入年兜底运营收入（元）"
												maxlength="20" lay-verify="required|floatNumber" autocomplete="off"
												onblur="isNumberAndFloat1(this);arabiaToCN(this,1);" class="layui-input">
										</div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label">年兜底运营成本（元）</label>
										<div class="layui-input-inline">
											<input type="text" id="perBottomOmCostId" name="perBottomOmCost"
												placeholder="请输入年兜底运营成本（元）" maxlength="20"
												lay-verify="required|floatNumber" autocomplete="off"
												onblur="isNumberAndFloat1(this);arabiaToCN(this,1);" class="layui-input">
										</div>
									</div>

								</div>

							</fieldset>
							<fieldset class="layui-elem-field layui-field-title fieldset"
								id="baseInfo">
								<legend class="layui-btn layui-legend"
									style="text-align: left; cursor: default;">公式信息></legend>
								<div class="layui-form-item">
									<div class="layui-inline">
										<label class="layui-form-label">名称</label>
										<div class="layui-input-inline">
											<input type="text" name="formulaType" value=""
												readonly="readonly" style="border: 0px" class="layui-input">
										</div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label" style="width:155px;">计算公式说明</label>
										<div class="layui-input-inline" style="width:150px;">
											<input type="text" name="formulaMemo" value=""
												readonly="readonly" style="border: 0px" class="layui-input">
										</div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label" style="width:140px;">参数详细说明</label>
										<div class="layui-input-inline" style="width:50px;">
											<input type="text" name="paraMemo" value=""
												readonly="readonly" style="border: 0px" class="layui-input">
										</div>
									</div>
								</div>
								<div class="layui-form-item">
									<!-- 灰色分割线 -->
									<hr class="layui-bg-gray">
								</div>
								<div class="layui-form-item">
									<div class="layui-inline">
										<label class="layui-form-label">可用性服务费</label>
										<div class="layui-input-inline">
											<input type="hidden" name="formulaTypes" value="1"/>
										</div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label" style="width:55px;"></label>
										<div class="layui-input-inline">
											<textarea id="formulaMemosId1" name="formulaMemos" class="layui-textarea" maxlength="250"  autocomplete="off"
											placeholder="请输入计算公式说明" lay-verify="required" style="width: 200px; min-height: 20px;"></textarea>
										</div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label" style="width:100px;"></label>
										<div class="layui-input-inline">
											<textarea id="paraMemosId1" name="paraMemos" class="layui-textarea" maxlength="250"  autocomplete="off"
											placeholder="请输入参数详细说明" lay-verify="required" style="width: 200px; min-height: 20px;"></textarea>
										</div>
									</div>

								</div>
								<div class="layui-form-item">
									<div class="layui-inline">
										<label class="layui-form-label">政策处理费</label>
										<div class="layui-input-inline">
											<input type="hidden" name="formulaTypes" value="2"/>
										</div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label" style="width:55px;"></label>
										<div class="layui-input-inline">
											<textarea id="formulaMemosId2" name="formulaMemos" class="layui-textarea" maxlength="250"  autocomplete="off"
											placeholder="请输入计算公式说明" lay-verify="required" style="width: 200px; min-height: 20px;"></textarea>
										</div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label" style="width:100px;"></label>
										<div class="layui-input-inline">
											<textarea id="paraMemosId2" name="paraMemos" class="layui-textarea" maxlength="250"  autocomplete="off"
											placeholder="请输入参数详细说明" lay-verify="required" style="width: 200px; min-height: 20px;"></textarea>											
										</div>
									</div>


								</div>
								<div class="layui-form-item">
									<div class="layui-inline">
										<label class="layui-form-label">使用者服务费</label>
										<div class="layui-input-inline">
											<input type="hidden" name="formulaTypes" value="3"/>
										</div>
									</div>
									<div class="layui-inline" >
										<label class="layui-form-label" style="width:55px;"></label>
										<div class="layui-input-inline" >
											<textarea id="formulaMemosId3" name="formulaMemos" class="layui-textarea" maxlength="250"  autocomplete="off"
											placeholder="请输入计算公式说明" lay-verify="required" style="width: 200px; min-height: 20px;"></textarea>
										</div>
									</div>
									<div class="layui-inline" >
										<label class="layui-form-label" style="width:100px;"></label>
										<div class="layui-input-inline">
											<textarea id="paraMemosId3" name="paraMemos" class="layui-textarea" maxlength="250"  autocomplete="off"
											placeholder="请输入参数详细说明" lay-verify="required" style="width: 200px; min-height: 20px;"></textarea>
										</div>
									</div>

								</div>
								<div class="layui-form-item">
									<div class="layui-inline">
										<label class="layui-form-label">可行性缺口补助（选填）</label>
										<div class="layui-input-inline">
											<input type="hidden" name="formulaTypes" value="4"/>
										</div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label" style="width:55px;"></label>
										<div class="layui-input-inline">
											<textarea id="formulaMemosId4" name="formulaMemos" class="layui-textarea" maxlength="250"  autocomplete="off"
											placeholder="请输入计算公式说明" style="width: 200px; min-height: 20px;"></textarea>
										</div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label" style="width:100px;"></label>
										<div class="layui-input-inline">
											<textarea id="paraMemosId4" name="paraMemos" class="layui-textarea" maxlength="250"  autocomplete="off"
											placeholder="请输入参数详细说明" style="width: 200px; min-height: 20px;"></textarea>
										</div>
									</div>

								</div>
								<div class="layui-form-item">
									<div class="layui-inline">
										<label class="layui-form-label">运营维护费（选填）</label>
										<div class="layui-input-inline">
											<input type="hidden" name="formulaTypes" value="5"/>
										</div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label" style="width:55px;"></label>
										<div class="layui-input-inline">
											<textarea id="formulaMemosId5" name="formulaMemos" class="layui-textarea" maxlength="250"  autocomplete="off"
											placeholder="请输入计算公式说明" style="width: 200px; min-height: 20px;"></textarea>
										</div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label" style="width:100px;"></label>
										<div class="layui-input-inline">
											<textarea id="paraMemosId5" name="paraMemos" class="layui-textarea" maxlength="250"  autocomplete="off"
											placeholder="请输入参数详细说明" style="width: 200px; min-height: 20px;"></textarea>
										</div>
									</div>

								</div>
								<div class="layui-form-item">
									<div class="layui-inline">
										<label class="layui-form-label">一次性支付</label>
										<div class="layui-input-inline">
											<input type="hidden" name="formulaTypes" value="6"/>
										</div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label" style="width:55px;"></label>
										<div class="layui-input-inline">
											<textarea id="formulaMemosId6" name="formulaMemos" class="layui-textarea" maxlength="250"  autocomplete="off"
											placeholder="请输入计算公式说明" lay-verify="required" style="width: 200px; min-height: 20px;"></textarea>
										</div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label" style="width:100px;"></label>
										<div class="layui-input-inline">
											<textarea id="paraMemosId6" name="paraMemos" class="layui-textarea" maxlength="250"  autocomplete="off"
											placeholder="请输入参数详细说明" lay-verify="required" style="width: 200px; min-height: 20px;"></textarea>
										</div>
									</div>

								</div>
							</fieldset>

							<fieldset class="layui-elem-field layui-field-title fieldset"
								id="otherInfo">
								<legend class="layui-btn layui-legend"
									style="text-align: left; cursor: default;">其他说明 ></legend>
								<div class="layui-form-item">
									<label class="layui-form-label" style="width: 150px;">建设期绩效考核说明</label>
									<div class="layui-input-block">
										<textarea id="buildKpiMemoId" name="buildKpiMemo" class="layui-textarea" maxlength="500"
											lay-verify="required" style="width: 899px; height: 90px;"></textarea>
									</div>
								</div>
								<div class="layui-form-item">
									<label class="layui-form-label" style="width: 150px;">运营期绩效考核说明</label>
									<div class="layui-input-block">
										<textarea id="omKipMemoId" name="omKipMemo" class="layui-textarea" maxlength="500"
											lay-verify="required" style="width: 899px; height: 90px;"></textarea>
									</div>
								</div>
								<div class="layui-form-item">
									<label class="layui-form-label" style="width: 150px;">主要调整内容描述（相对于招标文件、投标文件）</label>
									<div class="layui-input-block">
										<textarea id="mainMemoId" name="mainMemo" class="layui-textarea" maxlength="500"
											lay-verify="required" style="width: 899px; height: 90px;"></textarea>
									</div>
								</div>
								<div class="layui-form-item">
									<label class="layui-form-label" style="width: 150px;">调整文字说明（选填）</label>
									<div class="layui-input-block">
										<textarea name="noteMemo" class="layui-textarea" maxlength="500"
											style="width: 899px; height: 90px;"></textarea>
									</div>
								</div>
							</fieldset>
							<fieldset class="layui-elem-field layui-field-title fieldset"
								id="baseInfo">
								<legend class="layui-btn layui-legend"
									style="text-align: left; cursor: default;">附件></legend>
								<div style="margin-top: 20px;">
									<div class="layui-form-item">
										<label class="layui-form-label" style="width: 350px;">支持pdf、excel、word、图片资料，可上传多个</label>
									</div>
									<div class="layui-form-item">
										<label class="layui-form-label">Word版合同文本（选填）</label>
										<div class="layui-input-block">
											<div class="layui-upload">
												<button type="button" class="layui-btn" id="1-upload-more">上传</button>
												<div class="layui-upload-list" id="1-upload-more-list">
												</div>
											</div>
										</div>
									</div>
									<div class="layui-form-item">
										<label class="layui-form-label">PDF版合同文本（选填）</label>
										<div class="layui-input-block">
											<div class="layui-upload">
												<button type="button" class="layui-btn" id="2-upload-more">上传</button>
												<div class="layui-upload-list" id="2-upload-more-list">
												</div>
											</div>
										</div>
									</div>
									<div class="layui-form-item">
										<label class="layui-form-label">盖章版合同文本（选填）</label>
										<div class="layui-input-block">
											<div class="layui-upload">
												<button type="button" class="layui-btn" id="3-upload-more">上传</button>
												<div class="layui-upload-list" id="3-upload-more-list">
												</div>
											</div>
										</div>
									</div>
									<div class="layui-form-item">
										<label class="layui-form-label">其他附件（选填）</label>
										<div class="layui-input-block">
											<div class="layui-upload">
												<button type="button" class="layui-btn" id="4-upload-more">上传</button>
												<div class="layui-upload-list" id="4-upload-more-list">
												</div>
											</div>
										</div>
									</div>
								</div>
							</fieldset>

						</div>
						<div class="layui-tab-item">
							<fieldset class="layui-elem-field layui-field-title fieldset">
								<legend class="layui-btn layui-legend"
									style="text-align: left; cursor: default;">基础信息></legend>
								<div class="layui-form-item">
									<div class="layui-inline">
										<label class="layui-form-label">项目名称</label>
										<div class="layui-input-inline">
											<input type="text" id="id_ContractlistproName"
												name="ContractlistproName" value="" style="border: 0px;"
												readonly="readonly" class="layui-input">
										</div>
									</div>

								</div>
								<div class="layui-form-item">
									<div class="layui-inline">
										<label class="layui-form-label">对外下浮前金额（元）</label>
										<div class="layui-input-inline">
											<input type="text" id="amountbefore" name="outPreDownAmount"
												placeholder="请输入" readonly autocomplete="off"
												class="layui-input">
										</div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label">对外下浮率（%）</label>
										<div class="layui-input-inline">
											<input type="text" id="discount" value="0"
												name="outPreDownRate" placeholder="请输入" readonly
												autocomplete="off" class="layui-input">
										</div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label">对外下浮后金额（元）</label>
										<div class="layui-input-inline">
											<input type="text" id="amountafter" name="outAfterDownAmount"
												placeholder="请输入" readonly autocomplete="off"
												class="layui-input">
										</div>
									</div>
								</div>
							</fieldset>
							<fieldset class="layui-elem-field layui-field-title fieldset"
								style="text-align: center; cursor: default;">
								<div style="padding-top: 15px;">&nbsp;</div>
								<div class="layui-form-item">
									<shiro:hasPermission name="ADD_CONTRACTEXT">
										<a class="layui-btn layuiadmin-btn-admin " data-type="add"
											id=id_addNewsubitems> <i
											class="layui-icon layui-icon-add-1 layuiadmin-button-btn"></i>新增子项
										</a>
									</shiro:hasPermission>
								</div>
								<div class="contract-list"></div>
							</fieldset>
							<fieldset class="layui-elem-field layui-field-title fieldset"
								id="contract-sync-info"
								style="text-align: center; cursor: default; display: none;">
								<div style="padding-top: 15px;">&nbsp;</div>
								<div class="layui-form-item">
									<shiro:hasPermission name="ADD_CONTRACTEXT">
										<a class="layui-btn layuiadmin-btn-admin " data-type="add"
											id="contract-sync">同步至合同信息</a>
									</shiro:hasPermission>
								</div>

							</fieldset>
						</div>
					</div>
				</div>

				<div class="layui-form-item"
					style="position: fixed ! important; right: 30px; bottom: 45%; z-index: 10000;">
					<div class="layui-input-block">
						<button
							class="layui-btn layui-bg-blue layui-btn-normal layui-btn-lg  layui-btn-radius"
							type="button" lay-submit lay-filter="addInfo_form_submit"
							id="addInfo_form_submit">
							<i class="layui-icon layui-icon-ok layuiadmin-button-btn"></i> 提交
						</button>
					</div>
				</div>
			</form>
		</div>
	</div>
</body>
</html>
<script type="text/javascript"  >
	var proName;
	var proNameid;
	//静态资源路径前缀
	var staticPath = '${fileHttpPre}';
	var stateJSON = <infopub:dicJson groupNo="A00010028" />;

	layui
			.config({
				base : '${ctx}/resources/layuiadmin/' //静态资源所在路径
			})
			.extend({
				index : 'lib/index' //主入口模块
			})
			.use(
					[ 'index', 'set', 'upload', 'element', 'laydate' ],
					function() {

						var $ = layui.$, form = layui.form, element = layui.element, laydate = layui.laydate, upload = layui.upload;
						// 正则校验
						form.verify({
							//验证汉字
						    CHS:[
						    	/^[\u0391-\uFFE5]+$/
						    	,'只能输入汉字'
						  	],
						  	//名字校验
						  	COC: [
								/^[\u4e00-\u9fa5_a-zA-Z0-9]+$/
								,'请输入正确的名称'
						  	],
						  	//大于0的正整数
						  	intNumber:[
								/^[1-9]\d*$/
								,'请输入正确的数字'
						  	],
						  	//数字只能有两位小数
						  	floatNumber:[
								/^([-]?)([0-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
								,'请输入正确的数字'
						  	],
						  	telNumber:[/^[1][3,4,5,7,8,9][0-9]{9}$/
								  		,'请输入正确的号码'
							],
						  	//数字大于0，并只能有两位小数
						  	floatAmount:[
								/^([0-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
								//var pattern=/^((\d+\.\d*[1-9]\d{1})|(\d*[1-9]\d*\.\d{2}))$/; 
								,'请输入正确的数字'
						  	]
						});
						var fileFormatWord = 'application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document';
						var fileFormatPdf = 'application/pdf';
						var fileFormat = 'application/zip,application/x-rar-compressed,image/jpeg,image/png,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/pdf';
						uploadRender(1, upload,fileFormatWord, $);
						uploadRender(2, upload,fileFormatPdf, $);
						uploadRender(3, upload,fileFormat, $);
						uploadRender(4, upload,fileFormat, $);
						laydate.render({
							elem : '#id_successionAgreementDate',
							trigger : 'click'
						});
						laydate.render({
							elem : '#id_completionDateOfConstructionAndinstallation',
							trigger : 'click'
						});
						laydate.render({
							elem : '#id_operationEndDate',
							trigger : 'click'
						});
						checkValueVerifycontractCommencementDate(laydate, $);						
 						//项目名称监听
						form.on('select(add_select_proId)', function(data) {
							var id = data.value;
							proNameid = data.value;
							proName = data.elem.getAttribute('proName');
				 
							if(id==''||id==null){
								layer.msg('请选择项目名称',{icon: 1});
					    		return;
					    	}else{
					    		getMktDiscloseProByProId(id); 
					    	}							
						});
						//是否与项目合同信息一致监听
						form.on('select(is-it-consistent)', function(data) {
							var id = data.value;
							
							if(id=='1'){
								$("#add_from-bisModify").attr("disabled",'disabled');
								$("#id_format").attr("disabled",'disabled');
								$("#id_is_in_store").attr("disabled",'disabled');
								var backCheckbox = $("input[name=backMechs]");
								backCheckbox.each(function(){
						        	$(this).attr("disabled",'disabled');
						         	form.render();
						         })
						        $("#id_contractCommencementDate").attr("disabled",'disabled');
								$("#id_completionDateOfConstructionAndinstallation").attr("disabled",'disabled');
								$("#id_operationEndDate").attr("disabled",'disabled');
								$("#id_priceAdjustmentMethod").attr("readOnly",'true');	
								$("#id_Contractconstructionperiodyear").attr("readOnly",'true');
								$("#id_Contractoperationperiodyear").attr("readOnly",'true');
								$("#id_Totalcontractperiodyear").attr("readOnly",'true');
								$("#bankFundId").attr("readOnly",'true');
								$("#selfFundId").attr("readOnly",'true');
								$("#gdFundId").attr("readOnly",'true');
								$("#selfBackRateId").attr("readOnly",'true');
								$("#buildCapRateId").attr("readOnly",'true');
								$("#bankBackRateId").attr("readOnly",'true');
								$("#perOmFeeId").attr("readOnly",'true');
								$("#cashRateId").attr("readOnly",'true');
								$("#investBackRateId").attr("readOnly",'true');
								$("#perBottomOmIncomeId").attr("readOnly",'true');
								$("#perBottomOmCostId").attr("readOnly",'true');
								$("#bankFundPercentId").attr("readOnly",'true');
								$("#selfFundPercentId").attr("readOnly",'true');
								$("#gdFundPercentId").attr("readOnly",'true');
								$("#buildKpiMemoId").attr("readOnly",'true');
								$("#omKipMemoId").attr("readOnly",'true');
								$("#mainMemoId").attr("readOnly",'true');
								$("#formulaMemosId1").attr("readOnly",'true');
								$("#paraMemosId1").attr("readOnly",'true');
								$("#formulaMemosId2").attr("readOnly",'true');
								$("#paraMemosId2").attr("readOnly",'true');
								$("#formulaMemosId3").attr("readOnly",'true');
								$("#paraMemosId3").attr("readOnly",'true');
								$("#formulaMemosId4").attr("readOnly",'true');
								$("#paraMemosId4").attr("readOnly",'true');
								$("#formulaMemosId5").attr("readOnly",'true');
								$("#paraMemosId5").attr("readOnly",'true');
								$("#formulaMemosId6").attr("readOnly",'true');
								$("#paraMemosId6").attr("readOnly",'true');
								$("#1-upload-more-list").attr("readOnly",'true');
								$("#2-upload-more-list").attr("readOnly",'true');
								$("#3-upload-more-list").attr("readOnly",'true');
								$("#4-upload-more-list").attr("readOnly",'true');
								
							}else if(id=='2'){
								$("#add_from-bisModify").removeAttr("disabled");
								$("#id_format").removeAttr("disabled");
								$("#id_is_in_store").removeAttr("disabled");
								var backCheckbox = $("input[name=backMechs]");
								backCheckbox.each(function(){
						        	$(this).removeAttr("disabled");
						         	form.render();
						         })
								$("#id_contractCommencementDate").removeAttr("disabled");
								$("#id_completionDateOfConstructionAndinstallation").removeAttr("disabled");
								$("#id_operationEndDate").removeAttr("disabled");
								$("#id_priceAdjustmentMethod").removeAttr("readOnly");
								$("#id_Contractconstructionperiodyear").removeAttr("readOnly");
								$("#id_Contractoperationperiodyear").removeAttr("readOnly");
								$("#id_Totalcontractperiodyear").removeAttr("readOnly");
								$("#bankFundId").removeAttr("readOnly");
								$("#selfFundId").removeAttr("readOnly");
								$("#gdFundId").removeAttr("readOnly");
								$("#selfBackRateId").removeAttr("readOnly");
								$("#buildCapRateId").removeAttr("readOnly");
								$("#bankBackRateId").removeAttr("readOnly");
								$("#perOmFeeId").removeAttr("readOnly");
								$("#cashRateId").removeAttr("readOnly");
								$("#investBackRateId").removeAttr("readOnly");
								$("#perBottomOmIncomeId").removeAttr("readOnly");
								$("#perBottomOmCostId").removeAttr("readOnly");
								$("#bankFundPercentId").removeAttr("readOnly");
								$("#selfFundPercentId").removeAttr("readOnly");
								$("#gdFundPercentId").removeAttr("readOnly");
								$("#buildKpiMemoId").removeAttr("readOnly");
								$("#omKipMemoId").removeAttr("readOnly");
								$("#mainMemoId").removeAttr("readOnly");
								$("#formulaMemosId1").removeAttr("readOnly");
								$("#paraMemosId1").removeAttr("readOnly");
								$("#formulaMemosId2").removeAttr("readOnly");
								$("#paraMemosId2").removeAttr("readOnly");
								$("#formulaMemosId3").removeAttr("readOnly");
								$("#paraMemosId3").removeAttr("readOnly");
								$("#formulaMemosId4").removeAttr("readOnly");
								$("#paraMemosId4").removeAttr("readOnly");
								$("#formulaMemosId5").removeAttr("readOnly");
								$("#paraMemosId5").removeAttr("readOnly");
								$("#formulaMemosId6").removeAttr("readOnly");
								$("#paraMemosId6").removeAttr("readOnly");
								$("#1-upload-more-list").removeAttr("readOnly");
								$("#2-upload-more-list").removeAttr("readOnly");
								$("#3-upload-more-list").removeAttr("readOnly");
								$("#4-upload-more-list").removeAttr("readOnly");
								
							}
						});
						
						form.on('submit(addInfo_form_submit)',function (data) {
		                	$("#addInfo_form_submit").removeAttr("lay-submit").removeClass("layui-bg-blue").addClass("layui-btn-disabled");
		                	$("#add_from-bisModify").removeAttr("disabled");
		                	$("#id_format").removeAttr("disabled");
		                	$("#id_is_in_store").removeAttr("disabled");
		                	$("#id_contractCommencementDate").removeAttr("disabled");
		                	$("#id_completionDateOfConstructionAndinstallation").removeAttr("disabled");
		                	$("#id_operationEndDate").removeAttr("disabled");
		              	
		                	var backCheckbox = $("input[name=backMechs]");//回报机制
		                	 backCheckbox.each(function(){
						        $(this).removeAttr("disabled");						         
						     })	
						     form.render();
		                	var backMech = [];
		                	$("input:checkbox[name='backMechs']:checked").each(function(i){
		                		backMech.push($(this).val());
		                	});
					       $("#id_backMech").val(backMech.toString());
		                	
		              		layer.load();
		                   	//提交 Ajax 成功后，静态更新表格中的数据
		                   	
		                   	$.ajax({
		                       	type : 'post',
		            			url : basePath + '/contractExt/save',
		                       	data: $('#addInfo_form').serialize(),
		            			success:function(result){
		            				if(result.success){
		            					layer.closeAll('loading'); //关闭loading
		            					layer.msg('提交单据成功~',{icon: 1});
		            					//两秒后关闭当前页面
		            					setTimeout(function(){
		            						/**
		            						 * 查找父菜单，并刷新
		            						 */
		            						var topDoc = $(window.top.document);
		            						var path = basePath + '/contractExt/list';
		            						// 获取页面名称
		            						var name = topDoc.find(".layui-nav-item [lay-href^='" + path + "']").text();
		            						if(name == '' || name == null){
		            							name = '承继协议原合同';
		            						}
		            						window.parent.layui.index.openTabsPage(path, name);
		            						var iframe = window.parent.layui.admin.tabsBody(window.parent.layui.admin.tabsPage.index).find(".layadmin-iframe");
		            						iframe[0].contentWindow.location.reload(true);
		            						
		            						/**
		            						 * 关闭当前页
		            						 */
		            						var currPath = basePath + '/contractExt/add';
		            						var layid = topDoc.find("li[lay-id^='" + currPath + "']").attr('lay-id');
		            						window.parent.layui.element.tabDelete('layadmin-layout-tabs', layid);//关闭当前页
		            				        }, 2000);
		            				}else{
		            					layer.closeAll('loading'); //关闭loading
		              					$("#addInfo_form_submit").removeClass("layui-btn-disabled").addClass("layui-bg-blue").attr("lay-submit","");
		            					layer.msg(result.msg,{icon: 7});
		            			  	}
		            			}
		                   	});

		                });
					});

	
	var uploadRender = function(id, upload,fileFormat, $) {
		upload
				.render({
					elem : '#' + id + '-upload-more',
					url : basePath + '/contractExt/uploadAtt/',
					data : {
						types : id
					},
					multiple : true,
					accept : 'file',
					acceptMime : fileFormat,
					before : function(obj) {
						layer.load();
					},
					done : function(res) {
						if (res.code > 0) {
							layer.closeAll('loading');
							return layer.msg(res.msg, {
								icon : 7
							});
						}
						if (res.entity != null && res.entity.length > 0) {
							for ( var i in res.entity) {
								var preProject = res.entity[i];
								var arr = preProject.split("|");
								var imgSrc = "";
								var suffix = arr[1].substring(arr[1]
										.lastIndexOf(".") + 1, arr[1].length);
								if (suffix == 'jpg' || suffix == 'png') {
									imgSrc = "${fileHttpPre}/" + arr[3];
								} else {
									imgSrc = "${ctx}/resources/images/"
											+ suffix + ".jpg";
								}
								$('#' + id + '-upload-more-list')
										.append(
												'<div class="layui-upload-img-div" id="upload_img_'+arr[2]+'"><img src="'+imgSrc+'" title="'+ arr[1] +'" class="layui-upload-img"><div class="mask"><a href="javascript:void(0)" onclick="showImg(\''
														+ "${fileHttpPre}"
														+ arr[3]
														+ '\');">查看</a><a href="javascript:void(0)" onclick="del(\''
														+ arr[2]
														+ '\')";>删除</a></div><p>'
														+ arr[1]
														+ '</p><input type="hidden" value="'+preProject+'" id="fileAtt_'+arr[2]+'" name="fileAtts'+id+'" ></input></div>');
							}
						}
					},
					allDone : function(obj) {
						layer.closeAll('loading');
					},
					error : function() {
						layer.closeAll('loading');
						layer.msg("上传失败，请稍后再试~", {
							icon : 7
						});
					}
				});
	}
	//删除文件
	function del(index) {
		layui.$("#fileAtt_" + index).remove();
		layui.$("#upload_img_" + index).remove();
	}

	//根据url查看文件
	function showImg(url) {
		var openWin = window.open(url,'','left=410,height=768, width=1024, top=200,  toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');
	}
	
	//根据交底pk带出交底需要的字段
	function getMktDiscloseProByProId(id) {
		var $ = layui.$, form = layui.form, laydate=layui.laydate,upload = layui.upload
		$.ajax({
			type : "POST", //提交方式  
			url : "${ctx}/contractExt/getProContractByProCode",//路径  
			data : {
				"proCodeAndCodes" : id
			},//数据，这里使用的是Json格式进行传输  
			success : function(result) {//返回数据根据结果进行相应的处理 
				if (result.flag == true) {
					//项目名称带出项目基础信息
					$("#id_proCode")
						.attr("value", result.contractProCode.proCode);//项目编号
					if (result.contractProCode.orgAreaName != null) {
						$("#id_regionalCompany").attr("value",
								result.contractProCode.orgAreaName);//区域公司
						$("#areaId").attr("value",
								result.contractProCode.hrOrgAreaId);//区域公司id
					} else {
						$("#id_regionalCompany").attr("value", "暂时为空不可编辑");//区域公司
					}
					if (result.contractProCode.orgProName != null) {
						$("#id_projectCompany").attr("value",
								result.contractProCode.orgProName);//项目公司
						$("#compId").attr("value",
								result.contractProCode.hrOrgProId);//项目公司id	
					} else {
						$("#id_projectCompany").attr("value", "暂时为空不可编辑");//项目公司
		
					}
					$("#id_projectAddress").attr("value",
							result.contractProCode.sgCityName);//项目地址
					$("#id_ImplementingBody").attr("value",
							result.contractProCode.carryOrg);//实施机构
					$("#id_projectLeader").attr("value",
							result.contractProCode.proLeader);//项目负责人
					
					if($("#is-it-consistent").val()==1){
						//项目名称带出项目合同基础信息数据
						$("#add_from-bisModify").html('');
						var strValueModeBuffer = "";	
						if(result.contractProCode.valueMode != null){
							 if(result.contractProCode.valueMode=='1'){
								 strValueModeBuffer+= '<option value='+1+' selected>清单</option>';
								 strValueModeBuffer+= '<option value='+2+'>定额</option>';
								 strValueModeBuffer+= '<option value='+3+'>固定总价</option>';
								 strValueModeBuffer+= '<option value='+4+'>其他</option>	';
							 }else if(result.contractProCode.valueMode=='2'){
								 strValueModeBuffer+= '<option value='+2+' selected>定额</option>';
								 strValueModeBuffer+= '<option value='+1+'>清单</option>';
								 strValueModeBuffer+= '<option value='+3+'>固定总价</option>';
								 strValueModeBuffer+= '<option value='+4+'>其他</option>	';
							 }else if(result.contractProCode.valueMode=='3'){
								 strValueModeBuffer+= '<option value='+3+' selected>固定总价</option>';
								 strValueModeBuffer+= '<option value='+1+'>清单</option>';
								 strValueModeBuffer+= '<option value='+2+'>定额</option>';
								 strValueModeBuffer+= '<option value='+4+'>其他</option>	';
							 }else if(result.contractProCode.valueMode=='4'){
								 strValueModeBuffer+= '<option value='+4+' selected>其他</option>';
								 strValueModeBuffer+= '<option value='+1+'>清单</option>';
								 strValueModeBuffer+= '<option value='+2+'>定额</option>';
								 strValueModeBuffer+= '<option value='+3+'>固定总价</option>	';
							 }
						}
						$("#add_from-bisModify").append(strValueModeBuffer);//计价方式	
						$("#add_from-bisModify").attr("disabled",'disabled');
						$("#id_priceAdjustmentMethod").html(result.contractProCode.riseMode);//调价方式
						$("#id_priceAdjustmentMethod").attr("readOnly",'true');		
						$("#id_format").html('');
					      var strFormatBuffer = ""; 
					      if(result.contractProCode.bizType != null){
					        if(result.contractProCode.bizType=='1'){
					        	 strFormatBuffer+= '<option value='+1+' selected>公路</option>';
					        	 strFormatBuffer+= '<option value='+2+'>市政</option>';
						         strFormatBuffer+= '<option value='+3+'>铁路</option>';
						         strFormatBuffer+= '<option value='+4+'>房建</option> ';
						         strFormatBuffer+= '<option value='+5+'>棚改</option>';
						         strFormatBuffer+= '<option value='+6+'>学校</option>';
						         strFormatBuffer+= '<option value='+7+'>综合</option>';
						         strFormatBuffer+= '<option value='+8+'>医疗及养老</option> ';
						         strFormatBuffer+= '<option value='+9+'>土地增减挂钩</option> ';
					        }else if(result.contractProCode.bizType=='2'){
					        	 strFormatBuffer+= '<option value='+1+'>公路</option>';
						         strFormatBuffer+= '<option value='+2+' selected>市政</option>';
						         strFormatBuffer+= '<option value='+3+'>铁路</option>';
						         strFormatBuffer+= '<option value='+4+'>房建</option> ';
						         strFormatBuffer+= '<option value='+5+'>棚改</option>';
						         strFormatBuffer+= '<option value='+6+'>学校</option>';
						         strFormatBuffer+= '<option value='+7+'>综合</option>';
						         strFormatBuffer+= '<option value='+8+'>医疗及养老</option> ';
						         strFormatBuffer+= '<option value='+9+'>土地增减挂钩</option> ';
					        }else if(result.contractProCode.bizType=='3'){
					        	 strFormatBuffer+= '<option value='+1+'>公路</option>';
						         strFormatBuffer+= '<option value='+2+'>市政</option>';
						         strFormatBuffer+= '<option value='+3+' selected>铁路</option>';
						         strFormatBuffer+= '<option value='+4+'>房建</option> ';
						         strFormatBuffer+= '<option value='+5+'>棚改</option>';
						         strFormatBuffer+= '<option value='+6+'>学校</option>';
						         strFormatBuffer+= '<option value='+7+'>综合</option>';
						         strFormatBuffer+= '<option value='+8+'>医疗及养老</option> ';
						         strFormatBuffer+= '<option value='+9+'>土地增减挂钩</option> ';
					        }else if(result.contractProCode.bizType=='4'){
					        	 strFormatBuffer+= '<option value='+1+'>公路</option>';
						         strFormatBuffer+= '<option value='+2+'>市政</option>';
						         strFormatBuffer+= '<option value='+3+'>铁路</option>';
						         strFormatBuffer+= '<option value='+4+' selected>房建</option> ';
						         strFormatBuffer+= '<option value='+5+'>棚改</option>';
						         strFormatBuffer+= '<option value='+6+'>学校</option>';
						         strFormatBuffer+= '<option value='+7+'>综合</option>';
						         strFormatBuffer+= '<option value='+8+'>医疗及养老</option> ';
						         strFormatBuffer+= '<option value='+9+'>土地增减挂钩</option> ';
					        }else if(result.contractProCode.bizType=='5'){
					        	 strFormatBuffer+= '<option value='+1+'>公路</option>';
						         strFormatBuffer+= '<option value='+2+'>市政</option>';
						         strFormatBuffer+= '<option value='+3+'>铁路</option>';
						         strFormatBuffer+= '<option value='+4+'>房建</option> ';
						         strFormatBuffer+= '<option value='+5+' selected>棚改</option>';
						         strFormatBuffer+= '<option value='+6+'>学校</option>';
						         strFormatBuffer+= '<option value='+7+'>综合</option>';
						         strFormatBuffer+= '<option value='+8+'>医疗及养老</option> ';
						         strFormatBuffer+= '<option value='+9+'>土地增减挂钩</option> ';
					        }else if(result.contractProCode.bizType=='6'){
					        	strFormatBuffer+= '<option value='+1+'>公路</option>';
						         strFormatBuffer+= '<option value='+2+'>市政</option>';
						         strFormatBuffer+= '<option value='+3+'>铁路</option>';
						         strFormatBuffer+= '<option value='+4+'>房建</option> ';
						         strFormatBuffer+= '<option value='+5+'>棚改</option>';
						         strFormatBuffer+= '<option value='+6+' selected>学校</option>';
						         strFormatBuffer+= '<option value='+7+'>综合</option>';
						         strFormatBuffer+= '<option value='+8+'>医疗及养老</option> ';
						         strFormatBuffer+= '<option value='+9+'>土地增减挂钩</option> ';
					        }else if(result.contractProCode.bizType=='7'){
					        	 strFormatBuffer+= '<option value='+1+'>公路</option>';
						         strFormatBuffer+= '<option value='+2+'>市政</option>';
						         strFormatBuffer+= '<option value='+3+'>铁路</option>';
						         strFormatBuffer+= '<option value='+4+'>房建</option> ';
						         strFormatBuffer+= '<option value='+5+'>棚改</option>';
						         strFormatBuffer+= '<option value='+6+'>学校</option>';
						         strFormatBuffer+= '<option value='+7+' selected>综合</option>';
						         strFormatBuffer+= '<option value='+8+'>医疗及养老</option> ';
						         strFormatBuffer+= '<option value='+9+'>土地增减挂钩</option> ';
					        }else if(result.contractProCode.bizType=='8'){
					        	 strFormatBuffer+= '<option value='+1+'>公路</option>';
						         strFormatBuffer+= '<option value='+2+'>市政</option>';
						         strFormatBuffer+= '<option value='+3+'>铁路</option>';
						         strFormatBuffer+= '<option value='+4+'>房建</option> ';
						         strFormatBuffer+= '<option value='+5+'>棚改</option>';
						         strFormatBuffer+= '<option value='+6+'>学校</option>';
						         strFormatBuffer+= '<option value='+7+'>综合</option>';
						         strFormatBuffer+= '<option value='+8+' selected>医疗及养老</option> ';
						         strFormatBuffer+= '<option value='+9+'>土地增减挂钩</option> ';
					        }else if(result.contractProCode.bizType=='9'){
					        	 strFormatBuffer+= '<option value='+1+'>公路</option>';
						         strFormatBuffer+= '<option value='+2+'>市政</option>';
						         strFormatBuffer+= '<option value='+3+'>铁路</option>';
						         strFormatBuffer+= '<option value='+4+'>房建</option> ';
						         strFormatBuffer+= '<option value='+5+'>棚改</option>';
						         strFormatBuffer+= '<option value='+6+'>学校</option>';
						         strFormatBuffer+= '<option value='+7+'>综合</option>';
						         strFormatBuffer+= '<option value='+8+'>医疗及养老</option> ';
						         strFormatBuffer+= '<option value='+9+' selected>土地增减挂钩</option> ';
					        }
					      }
					    $("#id_format").append(strFormatBuffer);//业态								
						$("#id_format").attr("disabled",'disabled');
						$("#id_is_in_store").html('');
					      var strIsInStoreBuffer = ""; 
					      if(result.contractProCode.isInStore != null){
					        if(result.contractProCode.isInStore=='1'){
					        	strIsInStoreBuffer+= '<option value='+1+' selected>已入库</option>';
					        	strIsInStoreBuffer+= '<option value='+0+'>未入库</option>';
					        }else if(result.contractProCode.isInStore=='0'){
					        	strIsInStoreBuffer+= '<option value='+0+' selected>未入库</option>';
					        	strIsInStoreBuffer+= '<option value='+1+'>已入库</option>';
					        }
					      }
					      $("#id_is_in_store").append(strIsInStoreBuffer);//入库情况		
														
						$("#id_is_in_store").attr("disabled",'disabled');
						$("#id_backMech").attr("value",
								result.contractProCode.backMech);//回报机制		
						//获取回报机制复选框
						var backCheckbox = $("input[name=backMechs]");//回报机制
						backCheckbox.each(function(){
							if(result.contractProCode.backMech.indexOf($(this).val()) != -1){
				            	$(this).prop('checked', true);
							}else{
				            	$(this).prop('checked', false);
							}
				         	form.render();
				         })	
				         //合同建设期（年）
						$("#id_Contractconstructionperiodyear").attr("value",
								result.contractProCode.buildYears);
						$("#id_Contractconstructionperiodyear").attr("readOnly",'true');
						//计算合同建设期（天）		
						var bulidYears = $("#id_Contractconstructionperiodyear").val();					
						var bulidDays = parseFloat(bulidYears)*365;
						//判断合同建设期是否有小数点，有则需加一天
						if(parseFloat(bulidDays) > parseFloat((bulidDays+"").split(".")[0])){
							bulidDays = parseFloat((bulidDays+"").split(".")[0]) + 1;
						}
						
						$("#id_Contractconstructionperioddays").attr("value",
								bulidDays);
						//合同运营期（年）
						$("#id_Contractoperationperiodyear").attr("value",
								result.contractProCode.omYears);
						$("#id_Contractoperationperiodyear").attr("readOnly",'true');
						//计算合同运营期（天）		
						var omYears = $("#id_Contractoperationperiodyear").val();
						var omDays = parseFloat(omYears)*365;
						//判断合同建设期是否有小数点，有则需加一天
						if(parseFloat(omDays) > parseFloat((omDays+"").split(".")[0])){
							omDays = parseFloat((omDays+"").split(".")[0]) + 1;
						}
						$("#id_Contractoperationperioddays").attr("value",
								omDays);
						//总合同期（年）
						$("#id_Totalcontractperiodyear").attr("value",
								result.contractProCode.totalYears);
						$("#id_Totalcontractperiodyear").attr("readOnly",'true');
						//计算总合同期（天）		
						var totalYears = $("#id_Totalcontractperiodyear").val();
						var totalDays = parseFloat(totalYears)*365;
						//判断合同建设期是否有小数点，有则需加一天
						if(parseFloat(totalDays) > parseFloat((totalDays+"").split(".")[0])){
							totalDays = parseFloat((totalDays+"").split(".")[0]) + 1;
						}
						$("#id_Totalcontractperioddays").attr("value",
								totalDays);
						//合同开工日期
						var beginBuildDate = layui.util.toDateString(result.contractProCode.beginBuildDate,"yyyy-MM-dd");
						
						$("#id_contractCommencementDate").attr("value",beginBuildDate);
						//计算建工工程日期
						var nextday1 = addDate($("#id_contractCommencementDate").val(),
									bulidDays);
						$("#id_completionDateOfConstructionAndinstallation")
									.attr("value", nextday1);//建安竣工日期
												
						var nextday2 = addDate($("#id_contractCommencementDate").val(),
									totalDays);
						$("#id_operationEndDate").attr("value", nextday2);//运营结束日期
								
						$("#id_contractCommencementDate").attr("disabled",'disabled');
						$("#id_completionDateOfConstructionAndinstallation").attr("disabled",'disabled');
						$("#id_operationEndDate").attr("disabled",'disabled');
						
						$("#bankFundId").attr("value",
								result.contractProCode.bankFund);//银行融资资金（元）	
						$("#bankFundId").attr("readOnly",'true');	
						$("#selfFundId").attr("value",
								result.contractProCode.selfFund);//自有资本金（元）
						$("#selfFundId").attr("readOnly",'true');
						$("#gdFundId").attr("value",
								result.contractProCode.gdFund);//政府资本金（元）
						$("#gdFundId").attr("readOnly",'true');
						$("#selfBackRateId").attr("value",
								result.contractProCode.selfBackRate);//自有资本金回报率（%）	
						$("#selfBackRateId").attr("readOnly",'true');
						$("#buildCapRateId").attr("value",
								result.contractProCode.buildCapRate);//建设期融资利率（%）
						$("#buildCapRateId").attr("readOnly",'true');		
						$("#bankBackRateId").attr("value",
								result.contractProCode.bankBackRate);//银行融资回报率（%）
						$("#bankBackRateId").attr("readOnly",'true');	
						$("#perOmFeeId").attr("value",
								result.contractProCode.perOmFee);//年运营绩效服务费（元）
						$("#perOmFeeId").attr("readOnly",'true');
						$("#cashRateId").attr("value",
								result.contractProCode.cashRate);//折现率（%）
						$("#cashRateId").attr("readOnly",'true');
						$("#investBackRateId").attr("value",
								result.contractProCode.investBackRate);//投资回报率（%）	
						$("#investBackRateId").attr("readOnly",'true');
						$("#perBottomOmIncomeId").attr("value",
								result.contractProCode.perBottomOmIncome);//年兜底运营收入（元）
						$("#perBottomOmIncomeId").attr("readOnly",'true');
						$("#perBottomOmCostId").attr("value",
								result.contractProCode.perBottomOmCost);//年兜底运营成本（元）
						$("#perBottomOmCostId").attr("readOnly",'true');
								
						$("#bankFundPercentId").attr("value",result.contractProCode.bankFundPercent);//银行融资资金占比（%）
						$("#bankFundPercentId").attr("readOnly",'true');
						
						$("#selfFundPercentId").attr("value",result.contractProCode.selfFundPercent);//自有资本金占比（%）
						$("#selfFundPercentId").attr("readOnly",'true');
						
						$("#gdFundPercentId").attr("value",result.contractProCode.gdFundPercent);//政府资本金占比（%）
						$("#gdFundPercentId").attr("readOnly",'true');
						
						$("#buildKpiMemoId").html(result.contractProCode.buildKpiMemo);//建设期绩效考核说明
						$("#buildKpiMemoId").attr("readOnly",'true');
						$("#omKipMemoId").html(result.contractProCode.omKipMemo);//运营期绩效考核说明	
						$("#omKipMemoId").attr("readOnly",'true');
						$("#mainMemoId").html(result.contractProCode.mainMemo);//主要调整内容描述（相对于招标文件、投标文件）
						$("#mainMemoId").attr("readOnly",'true');
						
						//项目名称带出项目合同的公式信息数据
						var proContractUla = result.proContractUlaList;//接收公式信息集合
						layui.$.each(proContractUla, function(i,item){
							if(item.formulaType=='1'){
								$("#formulaMemosId1").html(item.formulaMemo);//可用性服务费计算公式说明
								$("#formulaMemosId1").attr("readOnly",'true');
								$("#paraMemosId1").html(item.paraMemo);//可用性服务费参数详细说明
								$("#paraMemosId1").attr("readOnly",'true');							
							}else if(item.formulaType=='2'){
								$("#formulaMemosId2").html(item.formulaMemo);//政策处理费计算公式说明
								$("#formulaMemosId2").attr("readOnly",'true');
								$("#paraMemosId2").html(item.paraMemo);//政策处理费参数详细说明
								$("#paraMemosId2").attr("readOnly",'true');
							}else if(item.formulaType=='3'){
								$("#formulaMemosId3").html(item.formulaMemo);//使用者服务费计算公式说明
								$("#formulaMemosId3").attr("readOnly",'true');
								$("#paraMemosId3").html(item.paraMemo);//使用者服务费参数详细说明
								$("#paraMemosId3").attr("readOnly",'true');
							}else if(item.formulaType=='4'){
								$("#formulaMemosId4").html(item.formulaMemo);//可行性缺口补助计算公式说明
								$("#formulaMemosId4").attr("readOnly",'true');
								$("#paraMemosId4").html(item.paraMemo);//可行性缺口补助参数详细说明
								$("#paraMemosId4").attr("readOnly",'true');
							}else if(item.formulaType=='5'){
								$("#formulaMemosId5").html(item.formulaMemo);//运营维护费计算公式说明
								$("#formulaMemosId5").attr("readOnly",'true');
								$("#paraMemosId5").html(item.paraMemo);//运营维护费参数详细说明
								$("#paraMemosId5").attr("readOnly",'true');
							}else if(item.formulaType=='6'){
								$("#formulaMemosId6").html(item.formulaMemo);//一次性支付计算公式说明
								$("#formulaMemosId6").attr("readOnly",'true');
								$("#paraMemosId6").html(item.paraMemo);//一次性支付参数详细说明
								$("#paraMemosId6").attr("readOnly",'true');
							}							
				        });
						//项目名称带出项目合同的附件信息数据
						var proContractAtt = result.proContractAttList;//合同的附件信息集合
						$(".layui-upload-list").each(function(){
							var id = $(this).attr("id");
							$("#"+id).html('');
						});
						if(proContractAtt.length > 0){
							layui.$.each(proContractAtt, function(i,item){
								var imgSrc = "";
								var suffix = item.fileSuffix;
								if(suffix == '.jpg' || suffix == '.png'){
									imgSrc = "${fileHttpPre}/"+item.filePath;
								}else{
									imgSrc = "${ctx}/resources/images/"+suffix.substring(1)+".jpg";
								}
								if(item.types == '1'){//Word版合同文本附件
				        			$('#1-upload-more-list').append('<div class="layui-upload-img-div" "><img src="'+imgSrc+'" title="'+ item.fileName +'" class="layui-upload-img"><div class="mask"><a href="javascript:void(0)" style="margin-left:12px" onclick="showImg(\''+"${fileHttpPre}"+item.filePath +'\');">查看</a><a href="javascript:void(0)" style="margin-left:12px" onclick="del(\''+"${fileHttpPre}"+item.filePath +'\');">删除</a></div><p>'+item.fileName+'</p></div> ');
				        			$("#1-upload-more-list").attr("readOnly",'true');
								}else if(item.types == '2'){//PDF版合同文本附件
									$('#2-upload-more-list').append('<div class="layui-upload-img-div" "><img src="'+imgSrc+'" title="'+ item.fileName +'" class="layui-upload-img"><div class="mask"><a href="javascript:void(0)" style="margin-left:12px" onclick="showImg(\''+"${fileHttpPre}"+item.filePath +'\');">查看</a><a href="javascript:void(0)" style="margin-left:12px" onclick="del(\''+"${fileHttpPre}"+item.filePath +'\');">删除</a></div><p>'+item.fileName+'</p></div> ');
									$("#2-upload-more-list").attr("readOnly",'true');
								}else if(item.types == '3'){//盖章版合同文本附件
									$('#3-upload-more-list').append('<div class="layui-upload-img-div" "><img src="'+imgSrc+'" title="'+ item.fileName +'" class="layui-upload-img"><div class="mask"><a href="javascript:void(0)" style="margin-left:12px" onclick="showImg(\''+"${fileHttpPre}"+item.filePath +'\');">查看</a><a href="javascript:void(0)" style="margin-left:12px" onclick="del(\''+"${fileHttpPre}"+item.filePath +'\');">删除</a></div><p>'+item.fileName+'</p></div> ');
									$("#3-upload-more-list").attr("readOnly",'true');
								}else if(item.types == '4'){//其他附件
									$('#4-upload-more-list').append('<div class="layui-upload-img-div" "><img src="'+imgSrc+'" title="'+ item.fileName +'" class="layui-upload-img"><div class="mask"><a href="javascript:void(0)" style="margin-left:12px" onclick="showImg(\''+"${fileHttpPre}"+item.filePath +'\');">查看</a><a href="javascript:void(0)" style="margin-left:12px" onclick="del(\''+"${fileHttpPre}"+item.filePath +'\');">删除</a></div><p>'+item.fileName+'</p></div> ');
									$("#4-upload-more-list").attr("readOnly",'true');
								}
							});
						}
						form.render();
					}else if($("#is-it-consistent").val()==2){
						//项目名称带出项目合同基础信息数据
						$("#add_from-bisModify").html('');
						var strValueModeBuffer = "";	
						if(result.contractProCode.valueMode != null){
							 if(result.contractProCode.valueMode=='1'){
								 strValueModeBuffer+= '<option value='+1+' selected>清单</option>';
								 strValueModeBuffer+= '<option value='+2+'>定额</option>';
								 strValueModeBuffer+= '<option value='+3+'>固定总价</option>';
								 strValueModeBuffer+= '<option value='+4+'>其他</option>	';
							 }else if(result.contractProCode.valueMode=='2'){
								 strValueModeBuffer+= '<option value='+2+' selected>定额</option>';
								 strValueModeBuffer+= '<option value='+1+'>清单</option>';
								 strValueModeBuffer+= '<option value='+3+'>固定总价</option>';
								 strValueModeBuffer+= '<option value='+4+'>其他</option>	';
							 }else if(result.contractProCode.valueMode=='3'){
								 strValueModeBuffer+= '<option value='+3+' selected>固定总价</option>';
								 strValueModeBuffer+= '<option value='+1+'>清单</option>';
								 strValueModeBuffer+= '<option value='+2+'>定额</option>';
								 strValueModeBuffer+= '<option value='+4+'>其他</option>	';
							 }else if(result.contractProCode.valueMode=='4'){
								 strValueModeBuffer+= '<option value='+4+' selected>其他</option>';
								 strValueModeBuffer+= '<option value='+1+'>清单</option>';
								 strValueModeBuffer+= '<option value='+2+'>定额</option>';
								 strValueModeBuffer+= '<option value='+3+'>固定总价</option>	';
							 }
						}
						$("#add_from-bisModify").append(strValueModeBuffer);//计价方式	
						$("#add_from-bisModify").removeAttr("disabled");
						$("#id_priceAdjustmentMethod").html(result.contractProCode.riseMode);//调价方式
						$("#id_priceAdjustmentMethod").removeAttr("readOnly");		
						$("#id_format").html('');
					      var strFormatBuffer = ""; 
					      if(result.contractProCode.bizType != null){
					        if(result.contractProCode.bizType=='1'){
					        	 strFormatBuffer+= '<option value='+1+' selected>公路</option>';
					        	 strFormatBuffer+= '<option value='+2+'>市政</option>';
						         strFormatBuffer+= '<option value='+3+'>铁路</option>';
						         strFormatBuffer+= '<option value='+4+'>房建</option> ';
						         strFormatBuffer+= '<option value='+5+'>棚改</option>';
						         strFormatBuffer+= '<option value='+6+'>学校</option>';
						         strFormatBuffer+= '<option value='+7+'>综合</option>';
						         strFormatBuffer+= '<option value='+8+'>医疗及养老</option> ';
						         strFormatBuffer+= '<option value='+9+'>土地增减挂钩</option> ';
					        }else if(result.contractProCode.bizType=='2'){
					        	 strFormatBuffer+= '<option value='+1+'>公路</option>';
						         strFormatBuffer+= '<option value='+2+' selected>市政</option>';
						         strFormatBuffer+= '<option value='+3+'>铁路</option>';
						         strFormatBuffer+= '<option value='+4+'>房建</option> ';
						         strFormatBuffer+= '<option value='+5+'>棚改</option>';
						         strFormatBuffer+= '<option value='+6+'>学校</option>';
						         strFormatBuffer+= '<option value='+7+'>综合</option>';
						         strFormatBuffer+= '<option value='+8+'>医疗及养老</option> ';
						         strFormatBuffer+= '<option value='+9+'>土地增减挂钩</option> ';
					        }else if(result.contractProCode.bizType=='3'){
					        	 strFormatBuffer+= '<option value='+1+'>公路</option>';
						         strFormatBuffer+= '<option value='+2+'>市政</option>';
						         strFormatBuffer+= '<option value='+3+' selected>铁路</option>';
						         strFormatBuffer+= '<option value='+4+'>房建</option> ';
						         strFormatBuffer+= '<option value='+5+'>棚改</option>';
						         strFormatBuffer+= '<option value='+6+'>学校</option>';
						         strFormatBuffer+= '<option value='+7+'>综合</option>';
						         strFormatBuffer+= '<option value='+8+'>医疗及养老</option> ';
						         strFormatBuffer+= '<option value='+9+'>土地增减挂钩</option> ';
					        }else if(result.contractProCode.bizType=='4'){
					        	 strFormatBuffer+= '<option value='+1+'>公路</option>';
						         strFormatBuffer+= '<option value='+2+'>市政</option>';
						         strFormatBuffer+= '<option value='+3+'>铁路</option>';
						         strFormatBuffer+= '<option value='+4+' selected>房建</option> ';
						         strFormatBuffer+= '<option value='+5+'>棚改</option>';
						         strFormatBuffer+= '<option value='+6+'>学校</option>';
						         strFormatBuffer+= '<option value='+7+'>综合</option>';
						         strFormatBuffer+= '<option value='+8+'>医疗及养老</option> ';
						         strFormatBuffer+= '<option value='+9+'>土地增减挂钩</option> ';
					        }else if(result.contractProCode.bizType=='5'){
					        	 strFormatBuffer+= '<option value='+1+'>公路</option>';
						         strFormatBuffer+= '<option value='+2+'>市政</option>';
						         strFormatBuffer+= '<option value='+3+'>铁路</option>';
						         strFormatBuffer+= '<option value='+4+'>房建</option> ';
						         strFormatBuffer+= '<option value='+5+' selected>棚改</option>';
						         strFormatBuffer+= '<option value='+6+'>学校</option>';
						         strFormatBuffer+= '<option value='+7+'>综合</option>';
						         strFormatBuffer+= '<option value='+8+'>医疗及养老</option> ';
						         strFormatBuffer+= '<option value='+9+'>土地增减挂钩</option> ';
					        }else if(result.contractProCode.bizType=='6'){
					        	strFormatBuffer+= '<option value='+1+'>公路</option>';
						         strFormatBuffer+= '<option value='+2+'>市政</option>';
						         strFormatBuffer+= '<option value='+3+'>铁路</option>';
						         strFormatBuffer+= '<option value='+4+'>房建</option> ';
						         strFormatBuffer+= '<option value='+5+'>棚改</option>';
						         strFormatBuffer+= '<option value='+6+' selected>学校</option>';
						         strFormatBuffer+= '<option value='+7+'>综合</option>';
						         strFormatBuffer+= '<option value='+8+'>医疗及养老</option> ';
						         strFormatBuffer+= '<option value='+9+'>土地增减挂钩</option> ';
					        }else if(result.contractProCode.bizType=='7'){
					        	 strFormatBuffer+= '<option value='+1+'>公路</option>';
						         strFormatBuffer+= '<option value='+2+'>市政</option>';
						         strFormatBuffer+= '<option value='+3+'>铁路</option>';
						         strFormatBuffer+= '<option value='+4+'>房建</option> ';
						         strFormatBuffer+= '<option value='+5+'>棚改</option>';
						         strFormatBuffer+= '<option value='+6+'>学校</option>';
						         strFormatBuffer+= '<option value='+7+' selected>综合</option>';
						         strFormatBuffer+= '<option value='+8+'>医疗及养老</option> ';
						         strFormatBuffer+= '<option value='+9+'>土地增减挂钩</option> ';
					        }else if(result.contractProCode.bizType=='8'){
					        	 strFormatBuffer+= '<option value='+1+'>公路</option>';
						         strFormatBuffer+= '<option value='+2+'>市政</option>';
						         strFormatBuffer+= '<option value='+3+'>铁路</option>';
						         strFormatBuffer+= '<option value='+4+'>房建</option> ';
						         strFormatBuffer+= '<option value='+5+'>棚改</option>';
						         strFormatBuffer+= '<option value='+6+'>学校</option>';
						         strFormatBuffer+= '<option value='+7+'>综合</option>';
						         strFormatBuffer+= '<option value='+8+' selected>医疗及养老</option> ';
						         strFormatBuffer+= '<option value='+9+'>土地增减挂钩</option> ';
					        }else if(result.contractProCode.bizType=='9'){
					        	 strFormatBuffer+= '<option value='+1+'>公路</option>';
						         strFormatBuffer+= '<option value='+2+'>市政</option>';
						         strFormatBuffer+= '<option value='+3+'>铁路</option>';
						         strFormatBuffer+= '<option value='+4+'>房建</option> ';
						         strFormatBuffer+= '<option value='+5+'>棚改</option>';
						         strFormatBuffer+= '<option value='+6+'>学校</option>';
						         strFormatBuffer+= '<option value='+7+'>综合</option>';
						         strFormatBuffer+= '<option value='+8+'>医疗及养老</option> ';
						         strFormatBuffer+= '<option value='+9+' selected>土地增减挂钩</option> ';
					        }
					      }
					    $("#id_format").append(strFormatBuffer);//业态								
						$("#id_format").removeAttr("disabled");
						$("#id_is_in_store").html('');
					      var strIsInStoreBuffer = ""; 
					      if(result.contractProCode.isInStore != null){
					        if(result.contractProCode.isInStore=='1'){
					        	strIsInStoreBuffer+= '<option value='+1+' selected>已入库</option>';
					        	strIsInStoreBuffer+= '<option value='+2+'>未入库</option>';
					        }else if(result.contractProCode.isInStore=='2'){
					        	strIsInStoreBuffer+= '<option value='+1+'>已入库</option>';
					        	strIsInStoreBuffer+= '<option value='+2+' selected>未入库</option>';
					        }
					      }
					      $("#id_is_in_store").append(strIsInStoreBuffer);//入库情况		
								
						
						$("#id_is_in_store").removeAttr("disabled");	
						$("#id_backMech").attr("value", result.contractProCode.backMech);//回报机制		
						//获取回报机制复选框
						var backCheckbox = $("input[name=backMechs]");//回报机制
						backCheckbox.each(function(){
							if(result.contractProCode.backMech.indexOf($(this).val()) != -1){
				            	$(this).prop('checked', true);
							}else{
				            	$(this).prop('checked', false);
							}
				         	form.render();
				         })	
				        backCheckbox.each(function(){
				        	$(this).removeAttr("disabled");
				         	form.render();
				         })	
				         //合同建设期（年）
						$("#id_Contractconstructionperiodyear").attr("value",
								result.contractProCode.buildYears);
						$("#id_Contractconstructionperiodyear").attr("readOnly",'true');
						//计算合同建设期（天）		
						var bulidYears = $("#id_Contractconstructionperiodyear").val();					
						var bulidDays = parseFloat(bulidYears)*365;
						//判断合同建设期是否有小数点，有则需加一天
						if(parseFloat(bulidDays) > parseFloat((bulidDays+"").split(".")[0])){
							bulidDays = parseFloat((bulidDays+"").split(".")[0]) + 1;
						}
						
						$("#id_Contractconstructionperioddays").attr("value",
								bulidDays);
						//合同运营期（年）
						$("#id_Contractoperationperiodyear").attr("value",
								result.contractProCode.omYears);
						$("#id_Contractoperationperiodyear").attr("readOnly",'true');
						//计算合同运营期（天）		
						var omYears = $("#id_Contractoperationperiodyear").val();
						var omDays = parseFloat(omYears)*365;
						//判断合同建设期是否有小数点，有则需加一天
						if(parseFloat(omDays) > parseFloat((omDays+"").split(".")[0])){
							omDays = parseFloat((omDays+"").split(".")[0]) + 1;
						}
						$("#id_Contractoperationperioddays").attr("value",
								omDays);
						//总合同期（年）
						$("#id_Totalcontractperiodyear").attr("value",
								result.contractProCode.totalYears);
						$("#id_Totalcontractperiodyear").attr("readOnly",'true');
						//计算总合同期（天）		
						var totalYears = $("#id_Totalcontractperiodyear").val();
						var totalDays = parseFloat(totalYears)*365;
						//判断合同建设期是否有小数点，有则需加一天
						if(parseFloat(totalDays) > parseFloat((totalDays+"").split(".")[0])){
							totalDays = parseFloat((totalDays+"").split(".")[0]) + 1;
						}
						$("#id_Totalcontractperioddays").attr("value",
								totalDays);
						//合同开工日期
						var beginBuildDate = layui.util.toDateString(result.contractProCode.beginBuildDate,"yyyy-MM-dd");
						
						$("#id_contractCommencementDate").attr("value",beginBuildDate);
						//计算建工工程日期
						var nextday1 = addDate($("#id_contractCommencementDate").val(),
								bulidDays);
						$("#id_completionDateOfConstructionAndinstallation")
									.attr("value", nextday1);//建安竣工日期
												
						var nextday2 = addDate($("#id_contractCommencementDate").val(),
								totalDays);
						$("#id_operationEndDate").attr("value", nextday2);//运营结束日期
							
						$("#id_contractCommencementDate").removeAttr("disabled");
						$("#id_completionDateOfConstructionAndinstallation").removeAttr("disabled");
						$("#id_operationEndDate").removeAttr("disabled");
						
						$("#bankFundId").attr("value",
								result.contractProCode.bankFund);//银行融资资金（元）	
						$("#bankFundId").removeAttr("readOnly");	
						$("#selfFundId").attr("value",
								result.contractProCode.selfFund);//自有资本金（元）
						$("#selfFundId").removeAttr("readOnly");
						$("#gdFundId").attr("value",
								result.contractProCode.gdFund);//政府资本金（元）
						$("#gdFundId").removeAttr("readOnly");
						$("#selfBackRateId").attr("value",
								result.contractProCode.selfBackRate);//自有资本金回报率（%）	
						$("#selfBackRateId").removeAttr("readOnly");
						$("#buildCapRateId").attr("value",
								result.contractProCode.buildCapRate);//建设期融资利率（%）
						$("#buildCapRateId").removeAttr("readOnly");		
						$("#bankBackRateId").attr("value",
								result.contractProCode.bankBackRate);//银行融资回报率（%）
						$("#bankBackRateId").removeAttr("readOnly");	
						$("#perOmFeeId").attr("value",
								result.contractProCode.perOmFee);//年运营绩效服务费（元）
						$("#perOmFeeId").removeAttr("readOnly");
						$("#cashRateId").attr("value",
								result.contractProCode.cashRate);//折现率（%）
						$("#cashRateId").removeAttr("readOnly");
						$("#investBackRateId").attr("value",
								result.contractProCode.investBackRate);//投资回报率（%）	
						$("#investBackRateId").removeAttr("readOnly");
						$("#perBottomOmIncomeId").attr("value",
								result.contractProCode.perBottomOmIncome);//年兜底运营收入（元）
						$("#perBottomOmIncomeId").removeAttr("readOnly");
						$("#perBottomOmCostId").attr("value",
								result.contractProCode.perBottomOmCost);//年兜底运营成本（元）
						$("#perBottomOmCostId").removeAttr("readOnly");
								
						$("#bankFundPercentId").attr("value",result.contractProCode.bankFundPercent);//银行融资资金占比（%）
						$("#bankFundPercentId").attr("readOnly",'true');
						
						$("#selfFundPercentId").attr("value",result.contractProCode.selfFundPercent);//自有资本金占比（%）
						$("#selfFundPercentId").attr("readOnly",'true');
						
						$("#gdFundPercentId").attr("value",result.contractProCode.gdFundPercent);//政府资本金占比（%）
						$("#gdFundPercentId").attr("readOnly",'true');		
								
								
						$("#buildKpiMemoId").html(result.contractProCode.buildKpiMemo);//建设期绩效考核说明
						$("#buildKpiMemoId").removeAttr("readOnly");
						$("#omKipMemoId").html(result.contractProCode.omKipMemo);//运营期绩效考核说明	
						$("#omKipMemoId").removeAttr("readOnly");
						$("#mainMemoId").html(result.contractProCode.mainMemo);//主要调整内容描述（相对于招标文件、投标文件）
						$("#mainMemoId").removeAttr("readOnly");
								
						//项目名称带出项目合同的公式信息数据		
						var proContractUla = result.proContractUlaList;//接收公式信息集合
						layui.$.each(proContractUla, function(i,item){
							if(item.formulaType=='1'){
								$("#formulaMemosId1").html(item.formulaMemo);//可用性服务费计算公式说明
								$("#formulaMemosId1").removeAttr("readOnly");
								$("#paraMemosId1").html(item.paraMemo);//可用性服务费参数详细说明
								$("#paraMemosId1").removeAttr("readOnly");							
							}else if(item.formulaType=='2'){
								$("#formulaMemosId2").html(item.formulaMemo);//政策处理费计算公式说明
								$("#formulaMemosId2").removeAttr("readOnly");
								$("#paraMemosId2").html(item.paraMemo);//政策处理费参数详细说明
								$("#paraMemosId2").removeAttr("readOnly");
							}else if(item.formulaType=='3'){
								$("#formulaMemosId3").html(item.formulaMemo);//使用者服务费计算公式说明
								$("#formulaMemosId3").removeAttr("readOnly");
								$("#paraMemosId3").html(item.paraMemo);//使用者服务费参数详细说明
								$("#paraMemosId3").removeAttr("readOnly");
							}else if(item.formulaType=='4'){
								$("#formulaMemosId4").html(item.formulaMemo);//可行性缺口补助计算公式说明
								$("#formulaMemosId4").removeAttr("readOnly");
								$("#paraMemosId4").html(item.paraMemo);//可行性缺口补助参数详细说明
								$("#paraMemosId4").removeAttr("readOnly");
							}else if(item.formulaType=='5'){
								$("#formulaMemosId5").html(item.formulaMemo);//运营维护费计算公式说明
								$("#formulaMemosId5").removeAttr("readOnly");
								$("#paraMemosId5").html(item.paraMemo);//运营维护费参数详细说明
								$("#paraMemosId5").removeAttr("readOnly");
							}else if(item.formulaType=='6'){
								$("#formulaMemosId6").html(item.formulaMemo);//一次性支付计算公式说明
								$("#formulaMemosId6").removeAttr("readOnly");
								$("#paraMemosId6").html(item.paraMemo);//一次性支付参数详细说明
								$("#paraMemosId6").removeAttr("readOnly");
							}
							
				        });									
						//项目名称带出项目合同的附件信息数据
						var proContractAtt = result.proContractAttList;//合同的附件信息集合
						$(".layui-upload-list").each(function(){
							var id = $(this).attr("id");
							$("#"+id).html('');
						});
						if(proContractAtt.length > 0){
							layui.$.each(proContractAtt, function(i,item){
								var imgSrc = "";
								var suffix = item.fileSuffix;
								if(suffix == '.jpg' || suffix == '.png'){
									imgSrc = "${fileHttpPre}/"+item.filePath;
								}else{
									imgSrc = "${ctx}/resources/images/"+suffix.substring(1)+".jpg";
								}
								if(item.types == '1'){//Word版合同文本附件
									$('#1-upload-more-list').append('<div class="layui-upload-img-div" "><img src="'+imgSrc+'" title="'+ item.fileName +'" class="layui-upload-img"><div class="mask"><a href="javascript:void(0)" style="margin-left:12px" onclick="showImg(\''+"${fileHttpPre}"+item.filePath +'\');">查看</a><a href="javascript:void(0)" style="margin-left:12px" onclick="del(\''+"${fileHttpPre}"+item.filePath +'\');">删除</a></div><p>'+item.fileName+'</p></div> ');
				        			$("#1-upload-more-list").removeAttr("readOnly");
								}else if(item.types == '2'){//PDF版合同文本附件
									$('#2-upload-more-list').append('<div class="layui-upload-img-div" "><img src="'+imgSrc+'" title="'+ item.fileName +'" class="layui-upload-img"><div class="mask"><a href="javascript:void(0)" style="margin-left:12px" onclick="showImg(\''+"${fileHttpPre}"+item.filePath +'\');">查看</a><a href="javascript:void(0)" style="margin-left:12px" onclick="del(\''+"${fileHttpPre}"+item.filePath +'\');">删除</a></div><p>'+item.fileName+'</p></div> ');
									$("#2-upload-more-list").removeAttr("readOnly");
								}else if(item.types == '3'){//盖章版合同文本附件
									$('#3-upload-more-list').append('<div class="layui-upload-img-div" "><img src="'+imgSrc+'" title="'+ item.fileName +'" class="layui-upload-img"><div class="mask"><a href="javascript:void(0)" style="margin-left:12px" onclick="showImg(\''+"${fileHttpPre}"+item.filePath +'\');">查看</a><a href="javascript:void(0)" style="margin-left:12px" onclick="del(\''+"${fileHttpPre}"+item.filePath +'\');">删除</a></div><p>'+item.fileName+'</p></div> ');
									$("#3-upload-more-list").removeAttr("readOnly");
								}else if(item.types == '4'){//其他附件
									$('#4-upload-more-list').append('<div class="layui-upload-img-div" "><img src="'+imgSrc+'" title="'+ item.fileName +'" class="layui-upload-img"><div class="mask"><a href="javascript:void(0)" style="margin-left:12px" onclick="showImg(\''+"${fileHttpPre}"+item.filePath +'\');">查看</a><a href="javascript:void(0)" style="margin-left:12px" onclick="del(\''+"${fileHttpPre}"+item.filePath +'\');">删除</a></div><p>'+item.fileName+'</p></div> ');
									$("#4-upload-more-list").removeAttr("readOnly");
								}
							});
						}
						form.render();
					}	
					//项目名称带出项目合同的合同投资信息数据
					var $contractInvestmentInfoPanel = 	$("#contract-investment-info .layui-form-item:nth-child(n+2)");
					var $contractInvestmentInfoBlank = $("#contract-investment-info .layui-form-item:first");
					
					$contractInvestmentInfoPanel.css('display','none');
					$contractInvestmentInfoBlank.css('display','blank');
					
					if(!!result.proContractInvest==true){
						$contractInvestmentInfoPanel.css('display','block');
						$contractInvestmentInfoBlank.css('display','none');
						
						$("#caeFeeLabel").text(result.proContractInvest.caeFee);//建安工程费
						$("#caeFeeId").attr("value", result.proContractInvest.caeFee);					
						$("#caeDownRateLabel").text(result.proContractInvest.caeDownRate +'%');//建安下浮率（综合）
						$("#caeDownRateId").attr("value", result.proContractInvest.caeDownRate);		
						$("#caeRateLabel").text(result.proContractInvest.caeRate+'%');//建安占比
						$("#caeRateId").attr("value", result.proContractInvest.caeRate);		
						$("#prepareFeeLabel").text(result.proContractInvest.prepareFee);//预备费
						$("#prepareFeeId").attr("value",
								result.proContractInvest.prepareFee);
						$("#buildOtherFeeLabel").text(result.proContractInvest.buildOtherFee);//建安工程其他费
						$("#buildOtherFeeId").attr("value",
								result.proContractInvest.buildOtherFee);
						$("#buildOrgFeeLabel").text(result.proContractInvest.buildOrgFee);//建设单位管理费
						$("#buildOrgFeeId").attr("value",
								result.proContractInvest.buildOrgFee);
						$("#gdReplaceFeeLabel").text(result.proContractInvest.gdReplaceFee);//政府代付费
						$("#gdReplaceFeeId").attr("value",
								result.proContractInvest.gdReplaceFee);
						$("#preFeeLabel").text(result.proContractInvest.preFee);//项目前期费
						$("#preFeeId").attr("value",
								result.proContractInvest.preFee);
						$("#moveFeeLabel").text(result.proContractInvest.moveFee);//征地拆迁费
						$("#moveFeeId").attr("value",
								result.proContractInvest.moveFee);
						$("#buildInterestLabel").text(result.proContractInvest.buildInterest);//建设期利息
						$("#buildInterestId").attr("value",
								result.proContractInvest.buildInterest);
						$("#buyFeeLabel").text(result.proContractInvest.buyFee);//设备及工器具购置
						$("#buyFeeId").attr("value",
								result.proContractInvest.buyFee);
						$("#flowFeeLabel").text(result.proContractInvest.flowFee);//铺底流动资金
						$("#flowFeeId").attr("value",
								result.proContractInvest.flowFee);
						$("#totalSumLabel").text(result.proContractInvest.totalSum);//投资合计
						$("#totalSumId").attr("value", result.proContractInvest.totalSum);
											
						$("#outPreDownAmountId").attr("value", result.proContractInvest.outPreDownAmount);
						$("#outPreDownRateId").attr("value", result.proContractInvest.outPreDownRate);
						$("#outAfterDownAmountId").attr("value", result.proContractInvest.outAfterDownAmount);
					}
				}
			}
		});
	}

	//合同开工日期
	function checkValueVerifycontractCommencementDate(laydate, $) {
		var Data_id_contractCommencementDate = laydate
				.render({
					elem : '#id_contractCommencementDate',
					trigger : 'click',
					done : function(value, date) {
						var valueContractconstructionperioddays = $(
								"#id_Contractconstructionperioddays").attr(
								"value");//合同建设期（天）
						var valueTotalcontractperioddays = $(
								"#id_Totalcontractperioddays").attr("value");//总合同期（天）
						var rgx = /^([-]?)([0-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/;
						
						if (rgx.test(valueContractconstructionperioddays)) {//'请输入正确数字，且保留两位小数！'
							var nextday1 = addDate(value,
									valueContractconstructionperioddays);
							$("#id_completionDateOfConstructionAndinstallation")
									.attr("value", nextday1);//建安竣工日期
						}
						if (rgx.test(valueTotalcontractperioddays)) {//'请输入正确数字，且保留两位小数！'
							var nextday2 = addDate(value,
									valueTotalcontractperioddays);
							$("#id_operationEndDate").attr("value", nextday2);//运营结束日期
						}
						
					}
				});
	}

	/**
	 * [dateAddDays 从某个日期增加n天后的日期]
	 * @param  {[string]} dateTemp  [日期字符串]
	 * @param  {[int]} days [增加的天数]
	 * @return {[string]}[增加n天后的日期字符串]
	 */
	 function addDate(dateTemp, days) {
	    var nDate = new Date(dateTemp);
	    var millSeconds = Math.abs(nDate) + (days * 24 * 60 * 60 * 1000);
	    var rDate = new Date(millSeconds);
	    var year = rDate.getFullYear();
	    var month = rDate.getMonth() + 1;
	    month = month < 10 ? "0"+month : month;
	    var date = rDate.getDate();
	    date = date < 10 ? "0"+date : date;
	    return (year + "-" + month + "-" + date);
	}
	// 请输入正确数字，且保留两位小数！
	function checkValueverifyNumber2(obj) {
		var $ = layui.$, form = layui.form
		if (obj.value == '' || obj.value == null) {
			return;
		}
		var rgx = /^([-]?)([0-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/;

		var boolrgx = rgx.test(obj.value);// true 
		var periodDays = parseFloat(obj.value)*365;
		//判断合同建设期是否有小数点，有则需加一天
		if(parseFloat(periodDays) > parseFloat((periodDays+"").split(".")[0])){
			periodDays = parseFloat((periodDays+"").split(".")[0]) + 1;
		}
		if (boolrgx) {
			if (obj.id == "id_Contractconstructionperiodyear") {//合同建设期（年）				
				$("#id_Contractconstructionperioddays").attr("value",periodDays);//合同建设期（天）
			} else if (obj.id == "id_Contractoperationperiodyear") {//合同运营期（年）
				$("#id_Contractoperationperioddays").attr("value",periodDays);//合同运营期（天）
			} else if (obj.id == "id_Totalcontractperiodyear") {//总合同期（年）
				$("#id_Totalcontractperioddays").attr("value", periodDays);//总合同期（天）
			}
		} else {
			obj.value =0;
			layer.msg('请输入正确数字，且保留两位小数！');
		}
	}
	//'请输入正确数字，且保留两位小数！'
	function isNumberAndFloat1(str) {
		var $ = layui.$, form = layui.form
		if (str.value == '' || str.value == null) {
			return;
		}
		var rgx = /^([-]?)([0-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/;

		var boolrgx = rgx.test(str.value);// true 
		if (boolrgx) {
			return true;
		} else {
			str.value =0;
			return false;
		}
	}
	//'请输入正确数字，且保留两位小数！'
	function isNumberAndFloat2(str) {
		var rgx = /^([-]?)([0-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/;

		var boolrgx = rgx.test(str);// true 
		if (boolrgx) {
			return true;
		} else {
			return false;
		}
	}
	function Format(datetime,fmt) {
        if (parseInt(datetime)==datetime) {
            if (datetime.length==10) {
                datetime=parseInt(datetime)*1000;
            } else if(datetime.length==13) {
                datetime=parseInt(datetime);
            }
        }
        datetime=new Date(datetime);
        var o = {
            "M+" : datetime.getMonth()+1,                 //月份
            "d+" : datetime.getDate(),                    //日
            "h+" : datetime.getHours(),                   //小时
            "m+" : datetime.getMinutes(),                 //分
            "s+" : datetime.getSeconds(),                 //秒
            "q+" : Math.floor((datetime.getMonth()+3)/3), //季度
            "S"  : datetime.getMilliseconds()             //毫秒
        };
        if(/(y+)/.test(fmt))
            fmt=fmt.replace(RegExp.$1, (datetime.getFullYear()+"").substr(4 - RegExp.$1.length));
        for(var k in o)
            if(new RegExp("("+ k +")").test(fmt))
                fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length)));
        return fmt;
	}
	function isNumberAndFloat3(){
		var $ = layui.$
		var rgx = /^([0-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/;
		var bankFund = $("#bankFundId").val();
		var selfFund = $("#selfFundId").val();
		var gdFund = $("#gdFundId").val();
		
		if(bankFund ==''||bankFund ==null){
			bankFund = 0;
			$("#bankFundId").val(0);
		}
		if(rgx.test(bankFund)==false){
			$("#bankFundId").val(0);
			layer.msg('请输入正确数字，且保留两位小数！');
		}
		if(selfFund ==''||selfFund ==null){
			selfFund = 0;
			$("#selfFundId").val(0);
		}
		if(rgx.test(selfFund)==false){
			$("#selfFundId").val(0);
			layer.msg('请输入正确数字，且保留两位小数！');
		}
		if(gdFund ==''||gdFund ==null){
			gdFund = 0;
			$("#gdFundId").val(0);
		}
		if(rgx.test(gdFund)==false){
			$("#gdFundId").val(0);
			layer.msg('请输入正确数字，且保留两位小数！');
		}		
		if(bankFund==0&&selfFund==0&&gdFund==0){
			$("#bankFundPercentId").val(0);
			$("#selfFundPercentId").val(0);
			$("#gdFundPercentId").val(0);
		}else{
			var total = parseFloat(bankFund) +  parseFloat(selfFund) + parseFloat(gdFund);
			var bankFundPercent = (bankFund/total)*100;
			var selfFundPercent = (selfFund/total)*100;
			var gdFundPercent = (gdFund/total)*100;
			
			if(bankFund==0&&selfFund==0&&gdFund!=0){
				$("#bankFundPercentId").val(0);
				$("#selfFundPercentId").val(0);
				$("#gdFundPercentId").val(gdFundPercent.toFixed(2));	
			}else if(selfFund==0&&gdFund==0&&bankFund!=0){
				$("#selfFundPercentId").val(0);
				$("#gdFundPercentId").val(0);
				$("#bankFundPercentId").val(bankFundPercent.toFixed(2));
			}else if(bankFund==0&&gdFund==0&&selfFund!=0){
				$("#bankFundPercentId").val(0);
				$("#gdFundPercentId").val(0);
				$("#selfFundPercentId").val(selfFundPercent.toFixed(2));
			}else if(bankFund==0&&selfFund!=0&&gdFund!=0){
				$("#bankFundPercentId").val(0);
				$("#selfFundPercentId").val(selfFundPercent.toFixed(2));
				$("#gdFundPercentId").val(gdFundPercent.toFixed(2));
			}else if(selfFund==0&&bankFund!=0&&gdFund!=0){
				$("#selfFundPercentId").val(0);
				$("#bankFundPercentId").val(bankFundPercent.toFixed(2));
				$("#gdFundPercentId").val(gdFundPercent.toFixed(2));
			}else if(gdFund==0&&bankFund!=0&&selfFund!=0){
				$("#gdFundPercentId").val(0);
				$("#selfFundPercentId").val(selfFundPercent.toFixed(2));
				$("#bankFundPercentId").val(bankFundPercent.toFixed(2));			
			}else{
				$("#bankFundPercentId").val(bankFundPercent.toFixed(2));
				$("#selfFundPercentId").val(selfFundPercent.toFixed(2));
				$("#gdFundPercentId").val(gdFundPercent.toFixed(2));			
			}
		}
	}
</script>